| View previous topic :: View next topic |
| Author |
Message |
cibonato Apprentice


Joined: 25 Apr 2006 Posts: 195 Location: Macross City
|
Posted: Fri Apr 20, 2012 8:17 pm Post subject: Name resolution priority (/etc/hosts or DNS). |
|
|
Hello, I've been trying to set the priority which my computer should resolv names but I think I'm doing something wrong. I have a couple of entries in /etc/hosts files (they are related with virtual machine the computer is running). I can ping those machines using the name I gave them in /etc/hosts file:
| Code: | $ ping gildavm
PING gildavm.localdomain (192.168.57.131) 56(84) bytes of data.
64 bytes from gildavm.localdomain (192.168.57.131): icmp_req=1 ttl=64 time=0.139 ms
64 bytes from gildavm.localdomain (192.168.57.131): icmp_req=2 ttl=64 time=0.094 ms |
On the other hand, if I use host or nslookup things seem not to work:
| Code: | $ host gildavm
Host gildavm not found: 3(NXDOMAIN) |
| Code: | $ nslookup gildavm
Server: my_dns_server_ip
Address: my_computer_ip#53
** server can't find gildavm: NXDOMAIN
|
Besides that, if I write http://gildavm at the browser it doesn't work either. The file /etc/host.conf has the line order hosts,bind and /etc/nsswitch.conf has hosts: file dns.
Suggestions?
Thank you. _________________ 64 Bits, good good! |
|
| Back to top |
|
 |
PaulBredbury Watchman


Joined: 14 Jul 2005 Posts: 7043
|
Posted: Fri Apr 20, 2012 8:56 pm Post subject: Re: Name resolution priority (/etc/hosts or DNS). |
|
|
| cibonato wrote: | | hosts: file dns |
You missed out the 's'
Should be: files dns |
|
| Back to top |
|
 |
Hu Watchman

Joined: 06 Mar 2007 Posts: 7678
|
Posted: Fri Apr 20, 2012 11:05 pm Post subject: Re: Name resolution priority (/etc/hosts or DNS). |
|
|
| cibonato wrote: | On the other hand, if I use host or nslookup things seem not to work:
| Code: | $ host gildavm
Host gildavm not found: 3(NXDOMAIN) |
| Code: | $ nslookup gildavm
Server: my_dns_server_ip
Address: my_computer_ip#53
** server can't find gildavm: NXDOMAIN |
| This is normal. Those tools make DNS queries. If the result cannot be found via DNS, then they will return a failure, even if the name could have been found through some other means. PaulBredbury's suggestion as to the cause of your real problem looks sound to me. |
|
| Back to top |
|
 |
cibonato Apprentice


Joined: 25 Apr 2006 Posts: 195 Location: Macross City
|
Posted: Fri Apr 20, 2012 11:20 pm Post subject: Re: Name resolution priority (/etc/hosts or DNS). |
|
|
| PaulBredbury wrote: | | cibonato wrote: | | hosts: file dns |
You missed out the 's'
Should be: files dns |
It was a typo. Sorry for the noise, the beloved s is where it's supposed to be.
Well, if the applications work this way it's OK. That's the way things are!
Thank you all. _________________ 64 Bits, good good! |
|
| Back to top |
|
 |
|