From owner-freebsd-questions@FreeBSD.ORG Mon Sep 20 12:37:38 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 347D616A4CE for ; Mon, 20 Sep 2004 12:37:38 +0000 (GMT) Received: from zim.0x7e.net (zim.0x7e.net [203.38.184.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A31743D46 for ; Mon, 20 Sep 2004 12:37:37 +0000 (GMT) (envelope-from listone@deathbeforedecaf.net) Received: from goo.0x7e.net ([203.38.184.164] helo=goo) by zim.0x7e.net with smtp (Exim 3.36 #1) id 1C9NQF-000HKg-00 for freebsd-questions@freebsd.org; Mon, 20 Sep 2004 22:07:35 +0930 Message-ID: <001401c49f0e$9c91b5d0$a4b826cb@goo> From: "Rob" To: Date: Mon, 20 Sep 2004 22:07:37 +0930 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: Hostname and interfaces X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2004 12:37:38 -0000 Fellow BSDers, 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 & interfaces is: 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 contrib/amd/fixmount/fixmount.c contrib/amd/wire-test/wire-test.c contrib/bind/bin/dnsquery/dnsquery.c contrib/cvs/src/server.c contrib/gcc/sys-protos.h contrib/gdb/gdb/m32r-rom.c contrib/ipfilter/common.c contrib/perl5/iperlsys.h contrib/perl5/objXSUB.h contrib/sendmail/mail.local/mail.local.c contrib/sendmail/src/daemon.c contrib/smbfs/lib/smb/nb_net.c contrib/tcsh/tc.func.c contrib/traceroute/traceroute.c crypto/heimdal/appl/login/utmp_login.c crypto/heimdal/lib/krb5/get_addrs.c crypto/kerberosIV/appl/bsd/su.c crypto/kerberosIV/appl/ftp/ftp/ruserpass.c crypto/kerberosIV/appl/sample/simple_client.c crypto/kerberosIV/appl/telnet/telnet/commands.c crypto/kerberosIV/include/win32/config.h crypto/kerberosIV/include/win32/roken.h crypto/kerberosIV/kadmin/kadm_ser_wrap.c crypto/kerberosIV/lib/krb/getaddrs.c crypto/kerberosIV/lib/krb/verify_user.c crypto/kerberosIV/slave/kprop.c crypto/openssh/auth-krb4.c crypto/openssh/logintest.c crypto/openssh/session.c kerberos5/include/config.h kerberosIV/include/config.h lib/libcompat/4.3/rexec.c libexec/bootpd/bootpd.c sbin/route/route.c usr.bin/su/su.c usr.bin/w/w.c usr.sbin/ppp/ipcp.c usr.sbin/ppp/radius.c usr.sbin/pppd/options.c usr.sbin/timed/timed/timed.c usr.sbin/timed/timedc/cmds.c usr.sbin/traceroute6/traceroute6.c 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? Thanks Rob.