From owner-freebsd-questions Sun Aug 20 05:43:04 1995 Return-Path: questions-owner Received: (from majordom@localhost) by freefall.FreeBSD.org (8.6.11/8.6.6) id FAA27500 for questions-outgoing; Sun, 20 Aug 1995 05:43:04 -0700 Received: from aries.ibms.sinica.edu.tw ([140.109.40.248]) by freefall.FreeBSD.org (8.6.11/8.6.6) with ESMTP id FAA27494 for ; Sun, 20 Aug 1995 05:42:59 -0700 Received: (from taob@localhost) by aries.ibms.sinica.edu.tw (8.6.11/8.6.9) id UAA27637; Sun, 20 Aug 1995 20:42:42 +0800 Date: Sun, 20 Aug 1995 20:42:41 +0800 (CST) From: Brian Tao To: David Kleiner cc: questions@freebsd.org Subject: Re: A `hostname` question In-Reply-To: <199508181506.LAA28210@panix2.panix.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: questions-owner@freebsd.org Precedence: bulk On Fri, 18 Aug 1995, David Kleiner wrote: > > Here is a quick question: is there any way to distinguish a hostname > by an interface, like with a Sun box? That is, to have on lo0 anything > but a 'localhost', or something else, in addition to localhost, and on > tun0/ppp0/sl0 the hostname assigned by an ISP? Now, I don't know why > anyone would do that to a poor box, yet... The easy way out is to simply name your interfaces by IP address in your /etc/hosts file, and make sure the "hosts" option comes before "bind" in /etc/resolv.conf. For example: 127.0.0.1 localhost barney.nsa.gov ... in my /etc/hosts allows me to do this: # ping -q barney.nsa.gov PING localhost (127.0.0.1): 56 data bytes ^C --- localhost ping statistics --- 18 packets transmitted, 18 packets received, 0% packet loss round-trip min/avg/max = 0.466/0.513/0.588 ms :) -- Brian ("Though this be madness, yet there is method in't") Tao taob@gate.sinica.edu.tw <-- work ........ play --> taob@io.org