LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-27-2014, 09:10 PM   #1
minlinux
LQ Newbie
 
Registered: Apr 2014
Posts: 7

Rep: Reputation: Disabled
dig localhost doesn't give the answer section


I'am trying to setup a DNS server on centos. My problem is that when I try to do dig google.com it works... but when i hit dig localhost it doesn't give the answer section also nslookup doesn't give the output.

[root@3i etc]# dig localhost

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> localhost ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 3763 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION: ;localhost. IN A

;; AUTHORITY SECTION: . 10510 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2014042701 1800 900 604800 86400

;; Query time: 18 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Sun Feb 9 13:39:47 2014 ;; MSG SIZE rcvd: 102

[root@3i etc]#

[root@3i etc]# nslookup localhost Server: 127.0.0.1 Address: 127.0.0.1#53

** server can't find localhost: NXDOMAIN

[root@3i etc]#

Any help would be appreciated...!!!

Last edited by minlinux; 04-27-2014 at 09:11 PM.
 
Old 04-27-2014, 10:02 PM   #2
psycroptic
Member
 
Registered: Aug 2011
Location: USA
Distribution: ArchLinux - 3.0 kernel
Posts: 349

Rep: Reputation: Disabled
please post the contents of /etc/named.conf and all of your zone files
 
Old 04-27-2014, 10:16 PM   #3
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
dig a specific name which you have configured in your local DNS server
 
Old 04-28-2014, 12:52 AM   #4
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
fwiw, on my centos 6.5 server that's successfully running bind, dig localhost doesn't return an answer either. I think localhost is normally defined in your /etc/hosts file not in the dns server.
 
Old 04-28-2014, 01:17 AM   #5
psycroptic
Member
 
Registered: Aug 2011
Location: USA
Distribution: ArchLinux - 3.0 kernel
Posts: 349

Rep: Reputation: Disabled
Quote:
Originally Posted by Doug G View Post
fwiw, on my centos 6.5 server that's successfully running bind, dig localhost doesn't return an answer either. I think localhost is normally defined in your /etc/hosts file not in the dns server.
not necessarily, can be either in /etc/hosts or in a zone file, with forward zone A record of hostname "localhost" mapped to 127.0.0.1
 
Old 05-01-2014, 01:17 PM   #6
rgistered
Member
 
Registered: Jan 2006
Distribution: arch, CentOS
Posts: 83

Rep: Reputation: 17
I had the same problem when I first tried to set it up on a CentOS box. Comes out that the culprit was SELinux. Turn off the SELinux temporarily and then try to 'dig' localhost to see if that works.
 
Old 05-18-2014, 10:02 AM   #7
minlinux
LQ Newbie
 
Registered: Apr 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hello folks,


Sorry for the late reply..... was out of town for some days...
I checked and found out that i forgot to configure iptables. port 53 is not allowed by iptables by default, we have to change the configuration of iptables for it.
did the necessary changes and bam...!!! everything was working smoothly....

Thanks for the replies...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] BIND-resolving name (dig -x ipaddr answer: 0) rpmacaspac Linux - Newbie 1 09-02-2013 11:01 PM
DIG doesn't answer for internal zones plvasco Linux - Server 3 05-21-2013 03:44 PM
[SOLVED] dig does not return answer section-- Please reply deepak_message Linux - Server 15 01-16-2012 04:03 AM
No Answer with DIG amplifire Linux - Server 2 05-18-2009 07:58 AM
dig @ works, dig doesn't eelgueta Linux - Networking 6 07-09-2007 06:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration