Re: /etc/hosts
Tom Marchand said the following on 9/1/08 7:52 PM: > Hi, > > I've got an issue where hosts defined in my /etc/hosts are not being > resolved. I've looked at resolv.conf, host.conf and nsswitch.conf and > everything looks ok. It's my understanding that with the below > configurations, /etc/hosts should be used first then DNS. Correct? > This is a 6.1 system. > Can we see your /etc/hosts file? Best, --Glenn ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: /etc/hosts
At 06:52 PM 9/1/2008, Tom Marchand wrote: Hi, I've got an issue where hosts defined in my /etc/hosts are not being resolved. I've looked at resolv.conf, host.conf and nsswitch.conf and everything looks ok. It's my understanding that with the below configurations, /etc/hosts should be used first then DNS. Correct? This is a 6.1 system. host# cat resolv.conf local domain nameserver x.x.x.x cat host.conf # Auto-generated from nsswitch.conf, do not edit hosts dns host# cat nsswitch.conf group: compat group_compat: nis hosts: files dns networks: files passwd: compat passwd_compat: nis shells: files Check your /etc/rc.conf and look that the correct IP and hostname are set in there. You may have a typo. -Derek -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: /etc/hosts
I am trying to resolve the 192.168.2.3 address. ::1 localhost.local localhost 127.0.0.1 localhost.local localhost 72.15.233.132 host.local host 72.15.233.132 host.local. 192.168.2.3 test On Sep 1, 2008, at 8:10 PM, Glenn Sieb wrote: Tom Marchand said the following on 9/1/08 7:52 PM: Hi, I've got an issue where hosts defined in my /etc/hosts are not being resolved. I've looked at resolv.conf, host.conf and nsswitch.conf and everything looks ok. It's my understanding that with the below configurations, /etc/hosts should be used first then DNS. Correct? This is a 6.1 system. Can we see your /etc/hosts file? Best, --Glenn ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: /etc/hosts
Everything is set correctly in rc.conf. What I have noticed is that ping can resolve hosts from /etc/hosts. I should mention that this machine has been running for 1.5 years and it wasn't until today that I've needed to add machines to /etc/hosts. On Sep 1, 2008, at 8:22 PM, Derek Ragona wrote: Check your /etc/rc.conf and look that the correct IP and hostname are set in there. You may have a typo. -Derek -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED] " ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: /etc/hosts
Tom Marchand <[EMAIL PROTECTED]> wrote: > Everything is set correctly in rc.conf. What I have noticed is that > ping can resolve hosts from /etc/hosts. If ping works then everything is fine in /etc/hosts. You haven't told us what program you're using to resolve the 'test' hostname. If you're using something like dig or nslookup, then this is expected behavior; those programs are *supposed* to query the name server and do not read /etc/hosts. -- Sahil Tandon <[EMAIL PROTECTED]> ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: /etc/hosts
At 08:53 PM 9/1/2008, Tom Marchand wrote: I am trying to resolve the 192.168.2.3 address. ::1 localhost.local localhost 127.0.0.1 localhost.local localhost 72.15.233.132 host.local host 72.15.233.132 host.local. 192.168.2.3 test On Sep 1, 2008, at 8:10 PM, Glenn Sieb wrote: Tom Marchand said the following on 9/1/08 7:52 PM: Hi, I've got an issue where hosts defined in my /etc/hosts are not being resolved. I've looked at resolv.conf, host.conf and nsswitch.conf and everything looks ok. It's my understanding that with the below configurations, /etc/hosts should be used first then DNS. Correct? This is a 6.1 system. Can we see your /etc/hosts file? Best, --Glenn What error are you getting from ping? Is it not able to ping the ip 192.168.2.3? Or is the ping unable to route to that network and host? -Derek -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: /etc/hosts
Derek Ragona <[EMAIL PROTECTED]> wrote: > What error are you getting from ping? I think the OP said he did not have a problem with ping. -- Sahil Tandon <[EMAIL PROTECTED]> ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: /etc/hosts reload ?
On Tue, Nov 25, 2003 at 03:06:46PM -0700, RYAN vAN GINNEKEN wrote: > after makeing changes to /ect/hosts do you have to reload the file > somehow or do the effects take immediately Changes take place immediately. -- Jonathan Chen <[EMAIL PROTECTED]> -- "Nyuck, nyuck, nyuck" - Curly ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: /etc/hosts not working
David Naylor <[EMAIL PROTECTED]> writes: > I am trying to redirect a URL request to a different address but it appears > that /etc/hosts is not doing the job. Example: > > 127.0.0.1 google.com > > The way I understand it is that by typing google.com in a web browser it > should result in the local page being displayed. It instead goes to the > proper Google page. > > `ping google.com' actually pings 127.0.0.1 but `host google' returns the > actual IP addresses for google. Sounds like your browser is using a proxy server which is doing the name resolution for you. > /etc/nsswitch.conf has `hosts: files dns' and host.conf has `hosts\n dns' > > Any idea why the system calls are not honouring /etc/hosts? Since ping works, I'm sure that they are. -- Lowell Gilbert, embedded/networking software engineer, Boston area http://be-well.ilk.org/~lowell/ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
RE: /etc/hosts not working
Hello David: _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Naylor Sent: Thursday, September 11, 2008 1:49 PM To: freebsd-questions@freebsd.org Subject: /etc/hosts not working * PGP Signed: 09/11/08 at 13:49:05 Hi, I am trying to redirect a URL request to a different address but it appears that /etc/hosts is not doing the job. Example: 127.0.0.1 google.com The way I understand it is that by typing google.com in a web browser it should result in the local page being displayed. It instead goes to the proper Google page. `ping google.com' actually pings 127.0.0.1 but `host google' returns the actual IP addresses for google. /etc/nsswitch.conf has `hosts: files dns' and host.conf has `hosts\n dns' Any idea why the system calls are not honouring /etc/hosts? Regards David * David Naylor <[EMAIL PROTECTED]> * 0xFF6916B2 man host shows that the host utility is specifically for DNS-resolved lookups and looks at /etc/resolv.conf, not /etc/hosts Regards, Mike PGP.sig Description: PGP signature
Re: /etc/hosts not working
David Naylor <[EMAIL PROTECTED]> wrote: > I am trying to redirect a URL request to a different address but it > appears that /etc/hosts is not doing the job. Example: > > 127.0.0.1 google.com > > The way I understand it is that by typing google.com in a web browser > it should result in the local page being displayed. It instead goes > to the proper Google page. Which browser? Works fine here; might be a browser cache issue. > `ping google.com' actually pings 127.0.0.1 but `host google' returns > the actual IP addresses for google. This means both ping and host are working as designed. -- Sahil Tandon <[EMAIL PROTECTED]> ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: /etc/hosts not working
> `ping google.com' actually pings 127.0.0.1 but `host google' returns > the actual IP addresses for google. ping will resolve the name using the mecanism defined in /etc/nsswitch.conf, usually: hosts: files dns nis try first /etc/hosts, then DNS, then NIS But host(1) command is designed to query DNS exclusively. Hence the different recults. Olivier ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: /etc/hosts isn't being read
Josh Paetzel <[EMAIL PROTECTED]> wrote: > I have a stock 6.0-RELEASE box that doesn't seem to be > reading /etc/hosts > > In /etc/hosts I have: > > 192.168.1.101 example example.example.org > > /etc/nsswitch.conf is stock: > > group: compat > group_compat: nis > hosts: files dns > networks: files > passwd: compat > passwd_compat: nis > shells: files > > $ host example > Host example not found: 3(NXDOMAIN) > > $ host example.example.org > Host example not found 3(NXDOMAIN) Did host ever query /etc/hosts? > What am I doing wrong here that is keeping /etc/hosts from being read? Does ping ignore /etc/hosts as well? [EMAIL PROTECTED] ~ $host localhost Host localhost not found: 3(NXDOMAIN) [EMAIL PROTECTED] ~ $ping localhost PING localhost (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.383 ms ^C --- localhost ping statistics --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.383/0.383/0.383/0.000 ms Fabian -- http://www.fabiankeil.de/ signature.asc Description: PGP signature
Re: /etc/hosts isn't being read
shells: files $ host example Host example not found: 3(NXDOMAIN) "host" command always use DNS. try ping, telnet, whatever use IP connections $ host example.example.org Host example not found 3(NXDOMAIN) What am I doing wrong here that is keeping /etc/hosts from being read? -- Thanks, Josh Paetzel ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]" ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: /etc/hosts isn't being read
On Thursday 13 April 2006 11:11, Wojciech Puchar wrote: > > shells: files > > > > $ host example > > Host example not found: 3(NXDOMAIN) > > "host" command always use DNS. try ping, telnet, whatever use IP > connections > > > $ host example.example.org > > Host example not found 3(NXDOMAIN) > > > > What am I doing wrong here that is keeping /etc/hosts from being > > read? Ok...That solved my hostname resolution issues. Now the next issue is why it takes ssh 60 seconds to give me a password prompt. I thought that was always caused by not having name resolution working. Any thoughts on this issue? -- Thanks, Josh Paetzel ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: /etc/hosts isn't being read
Josh Paetzel writes: > Ok...That solved my hostname resolution issues. Now the next > issue is why it takes ssh 60 seconds to give me a password > prompt. I thought that was always caused by not having name > resolution working. Any thoughts on this issue? You may have solved one name resolution problem; have you solved them all? The "N second delay" problem is usually caused by something trying to do a reverse name look-up. You either need to disable this, or make sure reverse look-ups work. Robert Huff ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: /etc/hosts isn't being read
On Thu, Apr 13, 2006 at 12:52:11PM -0400, Robert Huff wrote: > > You may have solved one name resolution problem; have you > solved them all? > The "N second delay" problem is usually caused by something > trying to do a reverse name look-up. You either need to disable > this, or make sure reverse look-ups work. % man nsswitch.conf Make sure /etc/nsswitch.conf lists "hosts: files dns" in that order to search the /etc/hosts file before DNS. -- David Kelly N4HHE, [EMAIL PROTECTED] Whom computers would destroy, they must first drive mad. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: /etc/hosts - how does that file work?? - was weird nfs issues.
On Thursday 04 June 2009 20:48:21 Peter wrote: > iH, > This all started with NFS not mounting at bootso, testing in VMs: > 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 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: /etc/hosts - how does that file work?? - was weird nfs issues.
> On Thursday 04 June 2009 20:48:21 Peter wrote: >> iH, >> This all started with NFS not mounting at bootso, testing in VMs: > > > >> 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? ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: /etc/hosts - how does that file work?? - was weird nfs issues.
On 6/4/09, Peter wrote: >> On Thursday 04 June 2009 20:48:21 Peter wrote: >>> iH, >>> This all started with NFS not mounting at bootso, testing in VMs: >> >> >> >>> 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@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: /etc/hosts - how does that file work?? - was weird nfs issues.
On Saturday 06 June 2009 20:44:38 Tim Judd wrote: > On 6/4/09, Peter wrote: > > I do not think /etc/hosts does round robin, I always assumed first match > > wins...DNS/bind I would understand... It's the same library call: gethostbyname(3) and friends. > > Why does ping always return the 172.20.6.1 address, > > and ftp,nc,ssh,telnet,fetch _always_ uses the 116 address? Again: client implementation is allowed to pick whichever it wants. > 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? Gotta agree with Tim here. I don't see the point for having two nets on one interface. They'll be hard to keep secure with firewall rules if you run the same services on them. > I'll help, when I can. but forcing this on /etc/hosts is a dead end. Problem is that nfs and DNS don't work well at all. For nfs best use IP or /etc/hosts. One drawback of using DNS with nfs is that if the hostname cannot be resolved (network down, typo), one can also not get a console when it goes to single user mode [1] and has to reboot via power button. /etc/fstab is supposed to be static to begin with. It's supposed to provide the mountpoints the system can count on, so using IP's for nfs is preferred. For the more dynamic nfs mounts, one can use hostnames and use noauto in the options column. [1] http://www.freebsd.org/cgi/query-pr.cgi?pr=128448 -- Mel ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"