Re: Is there any point to full host names in /etc/hosts ?



Rikishi 42 <skunkworks@xxxxxxxxxxxxx> writes:

This is the situation: a friend and I both use a broadband router with a few
machines behind them, at our respective homes. We each picked a name for our
'domain'. His is fictional. Mine also exists on the net, but with only the
www and ftp of rikishi42.net defined in the DNS, not my home machines.

He's added 2 of my PC's in the /etc/hosts of his laptop, for use when he
visits and connects it to my LAN.

This would be a sample from that file:

# Home net
192.168.108.101 desktop.myDomain desktop
192.168.108.124 laptop.myDomain laptop
192.168.108.101 server.myDomain server
#Rikishi's net
192.168.8.142 gramps.rikishi42.net gramps
192.168.8.181 pigmy.rikishi42.net pigmy


We've allways used this, works just fine.
When connectiong to my machines, he's allways used the short (host only)
name. Last time, he accidentally tried with the full name. It failed.


My guess is that, upon finding that rikishi42.net exists, there is an
attempt to get the address from the DNS, skipping hosts all together.

It depends on whether he told his system to look for the address in hosts
or in dns first.
/etc/hosts.conf and /etc/nsswitch.conf


But do I presume correctly, or is there more to it?

--
There is an art, it says, or rather, a knack to flying.
The knack lies in learning how to throw yourself at the ground and miss.
Douglas Adams
.



Relevant Pages

  • Re: Network: everything seems okay, but theres no connect
    ... Set up DNS. ... For local hostname lookup you can either fix the hosts ... Your windows machines having to contend themselves with LINK-LOCAL ... local- and caching DNS server, DHCP server, and maybe provide NTP too. ...
    (comp.unix.bsd.freebsd.misc)
  • Re: Flat Domain DNS Problem
    ... and a batch script to distribute it to the DMZ machines when you need to make changes. ... have a DNS server on the same system, the hosts file is not used to provide answers for DNS - it is stricly a resolution mechanism. ... depending on the suffix assignments on the machines - but this also only works for some environments. ...
    (microsoft.public.windows.server.dns)
  • Re: DHCP and DNS
    ... You may find it easier to give servers static private ... IP's that way you are assured your hosts entries or DNS entries are correct. ... All the FreeBSD machines run samba. ...
    (freebsd-questions)
  • Re: Is there any point to full host names in /etc/hosts ?
    ... machines behind them, at our respective homes. ... www and ftp of rikishi42.net defined in the DNS, not my home machines. ... The knack lies in learning how to throw yourself at the ground and miss. ...
    (comp.os.linux.networking)
  • Re: Is there any point to full host names in /etc/hosts ?
    ... machines behind them, at our respective homes. ... www and ftp of rikishi42.net defined in the DNS, not my home machines. ... There are programs you can run that will update the Dyndns listing automatically when your ISP changes your IP address. ...
    (comp.os.linux.networking)