Hostname and interfaces
listone at deathbeforedecaf.net
Mon Sep 20 05:37:38 PDT 2004
I have a FreeBSD 4.x firewall with 2 sis(4) interfaces on the inside, and a
PPPoE interface to the rest of the world.
According to the BIND FAQ, the ideal relationship between hostnames &
gethostbyname(gethostname) == gethostbyaddr(primary_interface_address)
For multihomed hosts, the difficulty is in choosing the 'primary' interface.
Normally, I would pick the default or upstream interface, but in this case
it's the least reliable due to the whims of my ISP. It's also missing when
the machine first boots, before mpd(8) starts.
So I'm wondering what happens if I don't assign the hostname to any
interface. I know that sendmail(8) gets upset when it can't resolve the
hostname, but do other applications care?
Doing a little research, I ran
# cd /usr/src
# find * -type f -name '*.[ch]' | xargs grep -l gethostname | \
xargs grep -l gethostbyname
This host runs very few applications, and with the exception of ssh none of
them are in this list.
Has anyone tried running a networked system with a non-resolvable hostname?
Apart from sendmail and general principles, what is likely to break?
More information about the freebsd-questions