[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: domain name of debian



Shu Hung (Koala) asked the simple question:
> where does the domain name of a debain stored?
> is there anyway to change it?

The "domain name" of the local host is the part of its fully qualified
domain name (FQDN) that follows the first dot.

The FQDN of the local host is its canonical host name (if the latter
is a FQDN).

The canonical host name of the local host is determined by the
resolver.  In the simplest configuration, where the resolver relies
on /etc/hosts, the canonical hostname is the first name on the line
that contains the unqualified hostname as an alias.  E.g., suppose the
hostname is 'foo'.  There is a line in /etc/hosts:

    12.13.14.15    foo.bar.com       foo

The resolver returns 'foo.bar.com' as the canonical hostname of foo.
Then the "domain name" of foo is 'bar.com'.

To display the canonical hostname of the local host, do:

    hostname --fqdn

To display only the "domain name" part of this you can do:

    dnsdomainname


Rus Foster answered:
> Try edit /etc/domainname or /etc/hostname

So far as I know there is no such file as /etc/domainname in Debian.

John Summerfield wrote:
> dnsdomainname is in /etc/resolv.conf

That is true in a sense.  The configuration of the resolver affects
the way it looks up names and thus can affect what it returns as a
canonical hostname.

He continued:
> NIS domain name may be in ...

We are talking about the DNS domain name, not the NIS domain name,
I presume.
--
Thomas Hood



Reply to: