[email protected]
[Top] [All Lists]

Re: Where does an ubuntu machine get it's doamin name from

Subject: Re: Where does an ubuntu machine get it's doamin name from
From: Derek Broughton
Date: Fri, 18 Sep 2009 11:14:59 -0300
Marius Gedminas wrote:

> On Wed, Sep 16, 2009 at 10:53:31AM -0300, Derek Broughton wrote:

>> If you don't have a static IP (and for multiple machines "at work" you
>> normally wouldn't) it's customary to get the domain name from the DHCP
>> server.
> That works fine for /etc/resolv.conf, i.e. looking up other hosts in the
> same domain by using short names, but I don't recal ever seeing hostname
> --fqdn output mylocalhostname.domainreceivedfromDHCPserver.  Are we
> talking about the same thing here?

Absolutely.  My machine "morgen" (/etc/hostname does _not_ contain an fqdn), 
is currently connected to the domain "mar.dfo-mpo.ca", and the DHCP server 
there sent back that domain name in the DHCP request.  So:
  $ hostname --fqdn

when I'm at home, my own DHCP server sends "pointerstop.ca", and my machine 
- with no special configuration at my end - is "morgen.pointerstop.ca".

/etc/dhcp3/dhclient.conf contains:

request ... domain-name ...

And that's all you need (and should be set by default).

According to "man hostname", the value returned from "hostname --fqdn" IS 
from the resolver (ie, generally based on what's in /etc/resolv.conf).

ubuntu-users mailing list
[email protected]
Modify settings or unsubscribe at: 

<Prev in Thread] Current Thread [Next in Thread>