LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   FQDN issue ! (https://www.linuxquestions.org/questions/linux-newbie-8/fqdn-issue-863980/)

noony123 02-21-2011 01:42 AM

FQDN issue !
 
Hi all.

I have centos on my VM machine. I setup basic bind, and now my windows XP is successfully browsing internet. Now when i set the FQDN of the centos machine using /etc/hosts file (shown below)

127.0.0.1 WAN-Admin localhost.localdomain localhost
10.1.2.4 WAN-Admin.lab.pc

Now i restarted the services and also the system. Now from xp machine when i ping wan-admin.lab.pc, its gives me error that name couldnt be found. Why is this so ? i am able to resolve any internet site through the same centos machine but am not able to resolve its FQDN ?
Kindly guide me

Edit: Do i need to make an entry of lab.pc in the named.conf file ?

corp769 02-21-2011 02:10 AM

Quote:

Originally Posted by noony123 (Post 4265579)
Edit: Do i need to make an entry of lab.pc in the named.conf file ?

Doesn't hurt to try :)

noony123 02-21-2011 02:17 AM

i am sure it will work. But can someone kindly explain me that without adding, why my DNS is not able to resolve wan-admin.lac.pc when this entry is present in /etc/hosts file ?

Pls guide me

noony123 02-21-2011 03:15 AM

Dear Sir,

this is my nsswitch file

#
# /etc/nsswitch.conf
#
#passwd: db files nisplus nis
#shadow: db files nisplus nis
#group: db files nisplus nis

passwd: files
shadow: files
group: files

#hosts: db files nisplus nis dns
hosts: files dns

# Example - obey only what nisplus tells us...
#services: nisplus [NOTFOUND=return] files
#networks: nisplus [NOTFOUND=return] files
#protocols: nisplus [NOTFOUND=return] files
#rpc: nisplus [NOTFOUND=return] files
#ethers: nisplus [NOTFOUND=return] files
#netmasks: nisplus [NOTFOUND=return] files

bootparams: nisplus [NOTFOUND=return] files

ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
services: files

netgroup: nisplus

publickey: nisplus

automount: files nisplus
aliases: files nisplus

As you can see, hosts will be checked in files first and then using dns. Why in my case, its not looking in /etc/hosts file ?

noony123 02-21-2011 03:29 AM

Ok pls confirm my findings

1) /etc/hosts is not used by BIND. We need h2n perl tool to translate host file to corresponding zone data file
2) In my case, i must add "lab.pc" zone to my named.conf

Pls guide me

bathory 02-21-2011 03:56 AM

Hi,

1. You're right. Bind uses dns queries to resolve hosts/domains. The hosts file is used locally by some utilities (like ping in your case).
2. If you want the host to be resolvable from other computers, then yes. You need to create the zone lab.pc in your name server and add an A record for the host in question.

noony123 02-21-2011 04:31 AM

THANKS ALOT SIR,

i dont have words to show my gratitude.

Thanks again


All times are GMT -5. The time now is 02:49 AM.