30 Apr 2008 JoeNotCharles   » (Journeyer)

How do I set my domain name?


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?
A: DNS

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.

Syndicated 2008-04-18 05:02:15 from I Am Not Charles

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!