Subject: Re: Improper domain name?
To: darkelf <dark3lf@home.com>
From: gabriel rosenkoetter <gr@eclipsed.net>
List: port-mac68k
Date: 02/24/2000 13:02:06
On Thu, Feb 24, 2000 at 12:07:21PM -0500, darkelf wrote:
> Does anyone know what this means:
>
> Can't get a (fully qualified) domain name in /etc/hosts ?
>
> I have this in my /etc/hosts
>
> 127.0.0.1 localhost
> 24.x.x.x my.domain.name
>
> I am using dhcp and have an internal address, should that also be reflected in
> /etc/hosts?
First off, there exists documentation which isn't very difficult to
find (though I'm sitting on an iMac in a public lab right now and
can't reference it) that explains all of this, which you should
probably go read rather than doing what you think might be correct
then coming here for help when it doesn't turn out correcty (this list
is more for the business of developing NetBSD than for helping
introduce basic Unix concepts).
Second, if you really have "24.x.x.x" literally in your /etc/hosts,
that is drastically wrong. Dotted qauds can contain only numerals, no
alphabetic characters allowed.
Third, if you have an IP address internal to your LAN, that's what you
should be using, not any kind of external IP address (or, worse, as
you seem to be trying to do, a subnet address). The whole point of
having an internal IP network is that your machine is unconcerned what
its representation on the external network is - the NAT box that
connects you to that internal network takes care of this for you.
So... if your internal network is (say) 10.0.0.0/24 and you've chosen
10.0.0.7 as your IP address, the entry in /etc/hosts should probably
look like this:
10.0.0.7 my my.domain.name
(Yes, entry for hostname and for fully-qualified domainname - IF YOU
HAVE ONE - because the former is what's used in /etc/ifconfig.<if> and
the latter is what domain name lookups will want.)
Fourth, you claim you're using DHCP, in which case you shouldn't be
entering a damn thing in /etc/hosts or in /etc/ifconfig.<if> - the
daemon takes care of this for you. /etc/hosts should only contain your
localhost entry and some other hosts that you want to get to without
preforming an nslookup (presuming you've ranked file before bind in
/etc/resolv.conf).
If any portion of this doesn't make sense, you should really find some
good documentation on TCP/IP and read it carefully before trying to
muck about too much in /etc. If, on the other hand, you don't want to,
then let DHCP do its job and don't get in the way. (The latter course
may be more sensible if the reason you want the NetBSD box on the
network has little to do with your learning networking protocols.)
~ g r @ eclipsed.net