Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Name resolution priority (/etc/hosts or DNS).
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cibonato
Apprentice
Apprentice


Joined: 25 Apr 2006
Posts: 200
Location: Macross City

PostPosted: Fri Apr 20, 2012 8:17 pm    Post subject: Name resolution priority (/etc/hosts or DNS). Reply with quote

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
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Fri Apr 20, 2012 8:56 pm    Post subject: Re: Name resolution priority (/etc/hosts or DNS). Reply with quote

cibonato wrote:
hosts: file dns

You missed out the 's' ;)

Should be: files dns
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 16008

PostPosted: Fri Apr 20, 2012 11:05 pm    Post subject: Re: Name resolution priority (/etc/hosts or DNS). Reply with quote

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
View user's profile Send private message
cibonato
Apprentice
Apprentice


Joined: 25 Apr 2006
Posts: 200
Location: Macross City

PostPosted: Fri Apr 20, 2012 11:20 pm    Post subject: Re: Name resolution priority (/etc/hosts or DNS). Reply with quote

PaulBredbury wrote:
cibonato wrote:
hosts: file dns

You missed out the 's' ;)

Should be: files dns


It was a typo. :oops: 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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum