Re: localhost or LAN addresses in /etc/hosts
- From: Chris G <cl@xxxxxxxx>
- Date: Fri, 12 Dec 2008 20:30:04 +0000
On Fri, Dec 12, 2008 at 02:51:26PM -0400, Derek Broughton wrote:
Chris G wrote:dnsmasq uses the entries in /etc/hosts to provide information to other
How does one decide whether to put a machine's name as a localhost
address or an actual LAN address in /etc/hosts?
My ubuntu server machine's name is isbd, this appears in three places
in /etc/hosts at the moment:-
127.0.0.1 isbd localhost.localdomain localhost
127.0.1.1 isbd
192.168.1.4 home.isbd.net isbd 84-45-228-40.no-dns-yet.enta.net
chris.isbd.net
This is all very well until one runs something like dnsmasq and get
localhost addresses when asking for the address of isbd.
I think the 127.0.1.1 is redundant and should be removed,
I'd say you're just thoroughly misconfigured. You _can't_ have isbd be
all three addresses. Personally, I don't think if you're running
dnsmasq, isbd should be in there at all - _that's_ why you're running
your own DNS.
machines on the LAN. Thus it *needs* an entry for isbd somewhere to
tell other machines what isbd's address is.
Without dnsmasq the addresses for isbd are all perfectly valid as far
as I understand it.
Yes, I realise that, I'm not quite sure why there are two but (withoutcan I also
remove the isbd from the 127.0.0.1 line as well? Why does it get put
there, maybe it's there for use when the machine gets its IP via DHCP
and thus it isn't fixed.
No. It's got nothing to do with DHCP. 127.0.0.1 and 127.0.1.1 are, for
all intents, the same address (the address of your "lo" interface - any address on the 127 subnet is masked to 127.0.0.0). The advantage of
using different numbers is that something like Apache's virtual hosts can
then see a different IP for each hostname - even though to the network,
it's the same.
dnsmasq) it doesn't actuall matter.
The 192.168.1.4, address _is_ likely DHCP related - at least, it wasNo, I have static addresses assigned so it's correct. Apart from
probably assigned by your router, and if so IT SHOULDN"T EVEN APPEAR in
/etc/hosts.
anything else how, otherwise, would one access things such as printers
(my 192.168.1.44 hp7310 for example), they have to be fixed addresses.
Now, the real question is what do you mean by "asking for the address of
isbd"? isbd is, by definition, your local machine, therefore a DNS
lookup should always give you 127.x.x.x. If you mean that you want the
address of the host "isbd" on your local network, then the name is
probably something like "isbd.isbd.net"
I'm talking about finding the address of "isbd" from another machine on
the LAN. That's what dnsmasq is for, if another machine on the LAN
asks for the address of "isbd" dnsmasq will tell it "192.168.1.4".
127.x.x.x is only the right address for "isbd" when the question is
asked from "isbd".
--
Chris Green
--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
- Follow-Ups:
- Re: localhost or LAN addresses in /etc/hosts
- From: Derek Broughton
- Re: localhost or LAN addresses in /etc/hosts
- From: Nils Kassube
- Re: localhost or LAN addresses in /etc/hosts
- References:
- localhost or LAN addresses in /etc/hosts
- From: Chris G
- Re: localhost or LAN addresses in /etc/hosts
- From: Derek Broughton
- localhost or LAN addresses in /etc/hosts
- Prev by Date: Learning tricks with Gmail
- Next by Date: Re: Cant get any ubuntu version/type to boot to the installer or livecd properly
- Previous by thread: Re: localhost or LAN addresses in /etc/hosts
- Next by thread: Re: localhost or LAN addresses in /etc/hosts
- Index(es):
Relevant Pages
|