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



On Fri, 2 Nov 2007 12:44:11 +0100, Rikishi 42 <skunkworks@xxxxxxxxxxxxx> wrote:
| 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.
|
| But do I presume correctly, or is there more to it?


/etc/nsswitch.conf determines whether DNS or /etc/hosts is checked
first, and whether the other is checked at all.

Sounds like your friend might have DNS first. The second choice is
generally only checked if the first fails (i.e DNS is unreachable). If
DNS returns a "host does not exist" error, that does not trigger a fall
back to /etc/hosts.


--
Reverend Paul Colquhoun, ULC. http://andor.dropbear.id.au/~paulcol
Asking for technical help in newsgroups? Read this first:
http://catb.org/~esr/faqs/smart-questions.html#intro
.



Relevant Pages

  • Sendmail: host name lookup failure
    ... mail to other machines on the LAN worked yesterday, ... server: tsb.coremedicalsolutions.com.: host name lookup failure ... If there is a local DNS ...
    (freebsd-questions)
  • Re: why am i sending mutt mail with my FQDN??
    ... you should either set up working DNS for all of your machines which ... send email (if you control the DNS for thought.org, ... refused if the host part of the argument to MAIL FROM: ...
    (freebsd-questions)
  • Re: Internet DNS, pinging www vs. " ", & Secondary DNS showing own local IP vs WAN
    ... Both machines are dedicated Public Only machines, ... its own WAN IP - Rest of network is on a seperate DLink and WAN IP from the ... the primary when I create a Host Record that points to the secondary's IP ... >> DNS, The DNS host files will show LAN IP address instead of the WAN ...
    (microsoft.public.win2000.dns)
  • Re: novice: problem adding second domain
    ... > To ping by host name from a different domain you will have to add ... > tab) Default is to append Primary DNS suffix, to ping both domains by ... Instead of being able to ping all machines across domains (which would ...
    (microsoft.public.windows.server.active_directory)
  • Re: novice: problem adding second domain
    ... > To ping by host name from a different domain you will have to add ... > tab) Default is to append Primary DNS suffix, to ping both domains by ... Instead of being able to ping all machines across domains (which would ...
    (microsoft.public.windows.server.dns)