I Am Not Charles

How do I set my domain name?

Posted in the Junk Room by Joe on April 18, 2008

Originally posted on AlumNit (back when it was open.nit.ca) on May 11, 2004:

A simple sounding question that nobody can answer:

Q: How do I set my domain name under Debian?
A: You don’t.
Q: So, when I type “hostname –fqdn”, where does it get the fqdn from?

You might run into this problem when installing something that refuses to start because “You have no domain name” (am-utils, for instance). “hostname –fqdn” will tell you what this program is complaining about.

Just forget about /etc/hostname and other distractions – it’s the resolver’s job to figure out your domain name. If you’re on a LAN with a competent DNS server (notably, if you get your address through dhcp), just make sure your own host is not in /etc/hosts, and “hostname –fqdn” will go ask DNS. If you have a static address (like if you’re setting up a home network), just add yourself, domain name and all, to /etc/hosts. If you’re getting a dynamic IP but the DNS server isn’t giving you the right thing – well, cry, I guess.

Commentary: Seems pretty obvious when you put it that way, but it took me ages to figure out what was wrong back in the day. I probably should have emphasized “keep your own hostname out of /etc/hosts” more, since that’s the only counter-intuitive part.

I noticed this while I was following links from my Advogato entries. Apart from the Python stuff it’s the only thing there that would fit in on a technical blog. Sooner or later I’ll move all the Python code here instead of just linking to it, and then everything will be in one place and there’ll be no reason to go back there.

Except for the CellPhoneServiceRant, which is pretty funny as a two-year record of my struggles.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: