On Thu, 27 Dec 2012 01:10:45 +0000, Jules Richardson wrote:
> In fact, I've got a system running slack 13.1 and have cross-checked
> files (nsswitch.conf, hosts, host.conf, resolv.conf) against this - it's
> set up in exactly the same way (barring hostname and IP address
> differences, of course) and behaves exactly as I'd expect when invoking
> 'hostname -f', resolving the local machine's hostname and DNS domain
> name from /etc/hosts immediately, even though resolv.conf is present.
I don't have Slackware 14, but I also have a Slackware 13.1 install and
did a quick test:
$ strace hostname -f |& grep open
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib64/libc.so.6", O_RDONLY) = 3
open("/etc/resolv.conf", O_RDONLY) = 3
open("/etc/nsswitch.conf", O_RDONLY) = 3
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib64/libnss_files.so.2", O_RDONLY) = 3
open("/etc/host.conf", O_RDONLY) = 3
open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 3
Even though I have "hosts: files dns" in nsswitch.conf and
"order hosts, bind" in host.conf on my Slackware 13.1 system
/etc/resolv.conf is read before any of those files are opened.
However, I guess that it only reads the file to get the domain line, my
hostname does not try to connect any DNS server listed in that file.
> So... am I missing something obvious (probably! :-)
What does your /etc/HOSTNAME look like? What does the line in /etc/hosts
look like? What does the domain line look like in resolv.conf?
regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc351(at)
poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost