Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-27-2014, 10:10 PM
|
#1
|
LQ Newbie
Registered: Apr 2014
Posts: 7
Rep:
|
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 10:11 PM.
|
|
|
04-27-2014, 11:02 PM
|
#2
|
Member
Registered: Aug 2011
Location: USA
Distribution: ArchLinux - 3.0 kernel
Posts: 349
Rep:
|
please post the contents of /etc/named.conf and all of your zone files
|
|
|
04-27-2014, 11:16 PM
|
#3
|
Senior Member
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278
Rep:
|
dig a specific name which you have configured in your local DNS server
|
|
|
04-28-2014, 01:52 AM
|
#4
|
Member
Registered: Jul 2013
Posts: 749
Rep:
|
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.
|
|
|
04-28-2014, 02:17 AM
|
#5
|
Member
Registered: Aug 2011
Location: USA
Distribution: ArchLinux - 3.0 kernel
Posts: 349
Rep:
|
Quote:
Originally Posted by Doug G
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
|
|
|
05-01-2014, 02:17 PM
|
#6
|
Member
Registered: Jan 2006
Distribution: arch, CentOS
Posts: 83
Rep:
|
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.
|
|
|
05-18-2014, 11:02 AM
|
#7
|
LQ Newbie
Registered: Apr 2014
Posts: 7
Original Poster
Rep:
|
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...
|
|
|
All times are GMT -5. The time now is 01:46 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|