[NTLUG:Discuss] Host / Domain Name

Chris Cox cjcox at acm.org
Fri Sep 2 11:09:28 CDT 2005


Dennis Rice wrote:
> When using RH / Fedora, I can issue the command 'hostname', and as I
> entered the information, I get back the hostname and domain name, as I
> entered them during installation.  If I query the system for the domain
> name, I get nothing.

domainname is for the setting of the NIS domain.  Has nothing to do
with an Internet domain name.

> 
> If I issue the command 'hostname -f', I get back "unknown host", and
> likewise for 'hostname -d'.  I would have assumed that these commands
> would have trunkated the fqdn.

hostname should NOT be FQDN'd.  An Internet domain extension is
compeletely arbitrary and a fuction of name resolution ONLY.

In other words, don't depend on being able to "determine" it.
It comes and goes as the wind.

> 
> If I issue the command 'domainname', I get back "(none)".  When doing a
> man on domainname, I get the page for hostname.
> 
> I can assign a domain name with the domainname command, but it is not
> permanent.
> 
> Where does RH / Fedora store the domain name?  Would appreciate if
> someone could provide insight and help my knowledge of this situation. 
> Want to document it in my book.

Domain name appending to unqualified names is a quick and dirty
convenience mechanism and this information is supplied by either:

domain ntlug.org

or

search ntlug.org microsoft.com

in your /etc/resolv.conf file.  The data for /etc/resolv.conf might
come out of /etc/sysconfig/network somewhere on Fedora (just a
guess).

The latter will append ntlug.org first to unqualified names
being resolved and then try microsoft.com.
(well, that's how it is supposed to work anyhow)

An /etc/resolv.conf by definition has one or the other and NOT
both.




More information about the Discuss mailing list