Date: Sun, 20 Aug 1995 20:42:41 +0800 (CST) From: Brian Tao <taob@gate.sinica.edu.tw> To: David Kleiner <kleiner@panix.com> Cc: questions@freebsd.org Subject: Re: A `hostname` question Message-ID: <Pine.BSI.3.91.950820203920.27031H-100000@aries> In-Reply-To: <199508181506.LAA28210@panix2.panix.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSI.3.91.950820203920.27031H-100000>
