Where does an ubuntu machine get it's doamin name from
marius at pov.lt
Wed Sep 16 12:39:56 UTC 2009
On Wed, Sep 16, 2009 at 08:11:04AM -0400, stan wrote:
> I need to change the domain on all of the machines at work by Friday. I had
> a contractor working on these machines and he "helped". That is he put
> shortt names in /etc/hostname, and /etc/mailname. This is NOT what I asked
> him to do, but it is what I found. My first thought is just to put the new
> FQDN in there, but this has my curiosity stired up. Where are these
> machines currently getting thier doamins from? They are not running NIS, so
> that can't be it.
/etc/hosts, usually. Try 'man hostname', it says the following:
You can’t change the FQDN (as returned by hostname --fqdn) or the DNS
domain name (as returned by dnsdomainname) with this command. The FQDN
of the system is the name that the resolver(3) returns for the host
Technically: The FQDN is the name gethostbyname(2) returns for the host
name returned by gethostname(2). The DNS domain name is the part after
the first dot.
Therefore it depends on the configuration (usually in /etc/host.conf)
how you can change it. Usually (if the hosts file is parsed before DNS
or NIS) you can change it in /etc/hosts.
/etc/hosts /etc/hostname This file should only contain domain name and
not the full FQDN.
So assuming you have widget.example.com, you should have the following
$ cat /etc/hostname
$ cat /etc/hosts
18.104.22.168 widget.example.com widget
If you don't have a static IP, it's customary to use a different loopback
$ cat /etc/hosts
127.0.1.1 widget.example.com widget
/etc/mailname ought to have the FQDN, according to 'man mailname'.
$ cat /etc/mailname
Hope that helped,
I am right now in the process of reading the Xft source code (the suspense near
the end of Chapter 7 is unbearable) [...]
-- Juliusz Chroboczek
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 189 bytes
Desc: Digital signature
More information about the ubuntu-users