lkml.org 
[lkml]   [2006]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] Add compile domain
Date
Lennart Sorensen <lsorense@csclub.uwaterloo.ca> wrote:
> I always thought that was how it worked. The first hostname in
> /etc/hosts on the line containing the short name was used as the FQDN.
> Maybe that is only a gnu hostname thing. I seem to recall solaris had a
> domainname file that was used to find the domain part of the FQDN
> instead.

yes this is how hostname works (see the man page)

# 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.

And yes, this is broken, but who used hostname -f anyway?

BTW: the above works also (better?) if you set the utsname to the FQDN like
Linus does.

Gruss
Bernd
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-05-27 04:15    [from the cache]
©2003-2011 Jasper Spaans