Re: /etc/hosts - how does that file work?? - was weird nfs issues.



On 6/4/09, Peter <fbsdq@xxxxxxxxxx> wrote:
On Thursday 04 June 2009 20:48:21 Peter wrote:
iH,
This all started with NFS not mounting at boot....so, testing in VMs:

<snip>

Why is ping using one IP, and ssh/mount_nfs/showmount using another IP
from /etc/hosts?

Q: Where is described that name resolution for A or PTR records should
be
returned in a fixed order and that a consumer should always use the
first
one
returned?
A: Nowhere. Name servers are encouraged to do round-robin returns if not
specified otherwise. Applications may sort/pick at their own leisure.

--
Mel

I do not think /etc/hosts does round robin, I always assumed first match
wins...DNS/bind I would understand...

Why does ping always return the 172.20.6.1 address,
and ftp,nc,ssh,telnet,fetch _always_ uses the 116 address?

I would assume at least sometimes it would hit the 172 address with
anything besides ping - but it only ping hits the 172 address...
If so, I'd guess there would be consistency between ping lookups and
'telnet/ssh/etc' lookups...

Why if the 116.23.45.3 last octet is bumped up, everything _always_
returns the 172 address?

client# grep server /etc/hosts
172.20.6.1 server.test server
116.23.45.5 server.test server
client# telnet server
Trying 172.20.6.1...
telnet: connect to address 172.20.6.1: Connection refused
Trying 116.23.45.5...

/etc/hosts - 'server' changed to
116.23.45.3:

client# telnet server
Trying 116.23.45.3...
telnet: connect to address 116.23.45.3: Operation timed out
Trying 172.20.6.1...
telnet: connect to address 172.20.6.1: Connection refused
telnet: Unable to connect to remote host

if server has ip>116.23.45.3, it always uses the 172 address first...

but ping always uses the 172...
even if third entry is added into /etc/hosts - nothing ever uses it as the
first/primary IP.

Is there an algorithm based on IP/program being used and the returned IP?




I can't sit and watch this thread anymore. Something itchin' to say:

DNS, who can handle multiple A records in an optional round-robin
design, is perfectly fine to assign multiple A records to a resource.

/etc/hosts, which as always existed (back when the Internet was
created/new), was a unique record source only. Having oddities in
/etc/hosts is expected IMHO when a "mistake" like multiple resources
assigned different records.


What's to stop you from creating slightly different records in
/etc/hosts? Whats to stop you from hitting 'privserver' and
'pubserver', for private and public IPs respectively.


why are you so hung up on dual IPs for a single host? would dnsmasq
provide a solution to dual A records for one resource?


I'll help, when I can. but forcing this on /etc/hosts is a dead end.
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • RE: cannot connect computer
    ... if I type in the url of the server i get through ok. ... client computer to SBS domain. ... | I am unable to ping the sbs server by ip or name. ...
    (microsoft.public.windows.server.sbs)
  • Re: Cannot connect to Server
    ... Test 1 - the clients can ping one anotehr ... gpupdate/force - reboot both client and server - ping to server from client ... Suggestion 2 - ping to server works when running safe mode with networking ...
    (microsoft.public.windows.server.sbs)
  • RE: Unable to ping client2
    ... I understand that the server box can not ping one ... client workstation after upgraded to SBS 2003 SP1. ... Reboot the SBS Server. ... On the client workstation, run "ipconfig /release" and then run ...
    (microsoft.public.windows.server.sbs)
  • Re: SBS 2003 SP 1 on MSDN disks
    ... the PPPoE client, which I believe it operate as, even if Earthlink does not know it, and stop using the Windows Server 2003 PPPoE client to connect. ... I have started the Telnet service on my client computer ... I have started the Telnet service on the SBS2003 server. ...
    (microsoft.public.windows.server.sbs)
  • Re: My Computers HATE each other
    ... server and client are on different subnets according to your IP ... > IP addresses, but they cannot ping each other. ... > List of NetBt transports currently bound to the Redir ...
    (microsoft.public.windows.server.general)