[SOLVED] nslookup error - ;; connection timed out; no servers could be reached
Linux - NetworkingThis 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.
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.
nslookup error - ;; connection timed out; no servers could be reached
I have a RHEL6 server configured. I have configured DNS server on this but unable to nslookup/dig itself. Getting the following error. Could anyone help me out with the solution and reason?
Below attached is the files output from the server.
[root@RHEL6VM ~]# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
search gaurav.com
nameserver 20.198.242.116
[root@RHEL6VM ~]# cat /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
zone "gaurav.com" IN {
type master;
file "forward.zone";
};
zone "242.198.20.in-addr.arpa" IN {
type master;
file "reverse.zone";
};
[root@RHEL6VM ~]#
[root@RHEL6VM ~]# cat /var/named/forward.zone
$TTL 86400
@ IN SOA RHEL6VM.gaurav.com root.RHEL6VM.gaurav.com (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS RHEL6VM.gaurav.com
RHEL6VM A 20.198.242.116
[root@RHEL6VM ~]#
[root@RHEL6VM ~]# cat /var/named/reverse.zone
$TTL 86400
@ IN SOA RHEL6VM.gaurav.com root.RHEL6VM.gaurav.com (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS RHEL6VM.gaurav.com
RHEL6VM A 20.198.242.116
116 PTR 20.198.242.
[root@RHEL6VM ~]#
[root@RHEL6VM ~]# service named status
version: 9.7.0-P2-RedHat-9.7.0-5.P2.el6
CPUs found: 1
worker threads: 1
number of zones: 15
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/0/1000
tcp clients: 0/100
server is up and running
named (pid 2809) is running...
[root@RHEL6VM ~]#
[root@RHEL6VM ~]# ping RHEL6VM
PING RHEL6VM.gaurav.com (20.198.242.116) 56(84) bytes of data.
64 bytes from RHEL6VM.gaurav.com (20.198.242.116): icmp_seq=1 ttl=64 time=0.075 ms
64 bytes from RHEL6VM.gaurav.com (20.198.242.116): icmp_seq=2 ttl=64 time=0.050 ms
^C
--- RHEL6VM.gaurav.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1970ms
rtt min/avg/max/mdev = 0.050/0.062/0.075/0.014 ms
[root@RHEL6VM ~]#
[root@RHEL6VM ~]# nslookup RHEL6VM
;; connection timed out; no servers could be reached
[root@RHEL6VM ~]# dig RHEL6VM
; <<>> DiG 9.7.0-P2-RedHat-9.7.0-5.P2.el6 <<>> RHEL6VM
;; global options: +cmd
;; connection timed out; no servers could be reached
[root@RHEL6VM ~]#
If there is not a firewall problem, then make sure that bind is running and listening on the correct IPs
Code:
netstat -tanpl|grep named
Quote:
And could u pls also elaborate why i need to add +search to my command.
If you're trying to resolve a non-FQDN, then you have to add the search option, so dig uses the search/domain line of /erc/resolv.conf: Here is the relevant snippet from the dig manpage:
Quote:
+[no]search
Use [do not use] the search list defined by the searchlist or domain directive in resolv.conf (if any). The search list is not used
by default.
I have done as you said but still getting the same result.
[root@RHEL6VM ~]# cat /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
I have done as you said but still getting the same result.
Most likely you're editing the wrong named.conf
I guess you're running bind chrooted, in which case the correct config file is /var/named/chroot/etc/named.conf
[root@RHEL6VM ~]# cp /etc/named.conf /var/named/chroot/etc/named.conf
cp: overwrite `/var/named/chroot/etc/named.conf'? y
[root@RHEL6VM ~]# cp /var/named/forward.zone /var/named/chroot/var/named/forward.zone
cp: overwrite `/var/named/chroot/var/named/forward.zone'? y
[root@RHEL6VM ~]# cp /var/named/reverse.zone /var/named/chroot/var/named/reverse.zone
cp: overwrite `/var/named/chroot/var/named/reverse.zone'? y
[root@RHEL6VM ~]# service named restart
Stopping named: [ OK ]
Starting named:
Error in named configuration:
zone gaurav.com/IN: has no NS records
zone gaurav.com/IN: not loaded due to errors.
_default/gaurav.com/IN: bad zone
zone 242.198.20.in-addr.arpa/IN: NS 'RHEL6VM.gaurav.com.242.198.20.in-addr.arpa' has no address records (A or AAAA)
zone 242.198.20.in-addr.arpa/IN: not loaded due to errors.
_default/242.198.20.in-addr.arpa/IN: bad zone
[FAILED]
[root@RHEL6VM ~]#
Error in named configuration:
zone gaurav.com/IN: has no NS records
zone gaurav.com/IN: not loaded due to errors.
_default/gaurav.com/IN: bad zone
zone 242.198.20.in-addr.arpa/IN: NS 'RHEL6VM.gaurav.com.242.198.20.in-addr.arpa' has no address records (A or AAAA)
zone 242.198.20.in-addr.arpa/IN: not loaded due to errors.
_default/242.198.20.in-addr.arpa/IN: bad zone
[FAILED]
To get rid of these errors try the following zone files:
Code:
; /var/named/chroot/var/named/forward.zone
$TTL 86400
@ IN SOA RHEL6VM.gaurav.com. root.RHEL6VM.gaurav.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS RHEL6VM.gaurav.com.
RHEL6VM A 20.198.242.116
[root@RHEL6VM named]# vi reverse.zone
[root@RHEL6VM named]# vi forward.zone
[root@RHEL6VM named]# service named restart
Stopping named: [ OK ]
Starting named: [ OK ]
[root@RHEL6VM named]# dig RHEL6VM
; <<>> DiG 9.7.0-P2-RedHat-9.7.0-5.P2.el6 <<>> RHEL6VM
;; global options: +cmd
;; connection timed out; no servers could be reached
[root@RHEL6VM named]# dig RHEL6VM +search
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.