LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-02-2016, 01:40 PM   #1
arun natarajan
Member
 
Registered: Jun 2014
Posts: 111

Rep: Reputation: Disabled
nslookup not working from client machine


hi,

i have configured DNS on server(node1) and client(node2).
on server everything is fine, when i tried to check DNS configuration from client end using ping and nslookup its failing.
====================================
server configuration details
=====================================

[root@node1 ~]# uname -a
Linux node1.cluster.com 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@node1 ~]#
[root@node1 ~]# ifconfig | head -3
eth0 Link encap:Ethernet HWaddr 00:0C:29:80:BF:63
inet addr:192.168.1.51 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fec0::10:20c:29ff:fe80:bf63/64 Scope:Site
[root@node1 ~]#
[root@node1 ~]# dig node1.cluster.com

; <<>> DiG 9.7.0-P2-RedHat-9.7.0-5.P2.el6 <<>> node1.cluster.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33283
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;node1.cluster.com. IN A

;; ANSWER SECTION:
node1.cluster.com. 86400 IN A 192.168.1.51

;; AUTHORITY SECTION:
cluster.com. 86400 IN NS node1.cluster.com.

;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Aug 3 00:03:11 2016
;; MSG SIZE rcvd: 65

[root@node1 ~]#
[root@node1 ~]# dig -x 192.168.1.51

; <<>> DiG 9.7.0-P2-RedHat-9.7.0-5.P2.el6 <<>> -x 192.168.1.51
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64313
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;51.1.168.192.in-addr.arpa. IN PTR

;; ANSWER SECTION:
51.1.168.192.in-addr.arpa. 86400 IN PTR node1.cluster.com.

;; AUTHORITY SECTION:
1.168.192.in-addr.arpa. 86400 IN NS node1.cluster.com.

;; ADDITIONAL SECTION:
node1.cluster.com. 86400 IN A 192.168.1.51

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Aug 3 00:03:22 2016
;; MSG SIZE rcvd: 104

[root@node1 ~]# nslookup cluster.com
Server: 127.0.0.1
Address: 127.0.0.1#53

Name: cluster.com
Address: 192.168.1.51

====================================
client configuration details
=====================================


[root@node2 ~]# uname -a
Linux node2.cluster.com 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@node2 ~]#
[root@node2 ~]#
[root@node2 ~]# cat /etc/hosts
192.168.1.52 node2.cluster.com node2 # Added by NetworkManager
127.0.0.1 localhost.localdomain localhost
::1 node2.cluster.com node2 localhost6.localdomain6 localhost6
[root@node2 ~]#
[root@node2 ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=node2.cluster.com
[root@node2 ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search cluster.com
# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
[root@node2 ~]#
[root@node2 ~]# ifconfig | head -3
eth0 Link encap:Ethernet HWaddr 00:0C:29:6F:83:4B
inet addr:192.168.1.52 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fec0::10:20c:29ff:fe6f:834b/64 Scope:Site
[root@node2 ~]#
[root@node2 ~]#
[root@node2 ~]# ping 192.168.1.51
PING 192.168.1.51 (192.168.1.51) 56(84) bytes of data.
64 bytes from 192.168.1.51: icmp_seq=1 ttl=64 time=0.373 ms
64 bytes from 192.168.1.51: icmp_seq=2 ttl=64 time=0.544 ms
64 bytes from 192.168.1.51: icmp_seq=3 ttl=64 time=0.540 ms
^C
--- 192.168.1.51 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2929ms
rtt min/avg/max/mdev = 0.373/0.485/0.544/0.083 ms
[root@node2 ~]#
[root@node2 ~]# ping node1.cluster.com
ping: unknown host node1.cluster.com
[root@node2 ~]#
[root@node2 ~]# nslookup cluster.com
;; connection timed out; no servers could be reached

 
Old 08-02-2016, 02:55 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
[root@node2 ~]# nslookup cluster.com
;; connection timed out; no servers could be reached
You don't have any nameserver defined in /etc/resolv.conf

Just follow the instructions given in /etc/resolv.conf and add your nameserver in the appropriate script:
Quote:
[root@node2 ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search cluster.com
# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
Regards
 
1 members found this post helpful.
Old 08-02-2016, 10:49 PM   #3
arun natarajan
Member
 
Registered: Jun 2014
Posts: 111

Original Poster
Rep: Reputation: Disabled
hi,

i have added below entry, i works fine now.

[root@node2 network-scripts]# cat /etc/resolv.conf
# Generated by NetworkManager
search cluster


# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
nameserver 192.168.1.51
 
Old 08-03-2016, 02:04 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by arun natarajan View Post
hi,

i have added below entry, i works fine now.

[root@node2 network-scripts]# cat /etc/resolv.conf
# Generated by NetworkManager
search cluster


# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
nameserver 192.168.1.51
You should follow the instructions in /etc/resolv.conf and add the dns entry in the script used to bring up your nic. Otherwise if you're using NM, the entry you've added manually in /etc/rseolv.conf will be lost in the next reboot.
I guess you're running an RHEL based distro, in which case you should add in /etc/sysconfig/network-scripts/ifcfg-eth0
Code:
DNS1=192.168.1.51

Last edited by bathory; 08-03-2016 at 02:34 AM. Reason: typo
 
1 members found this post helpful.
Old 08-03-2016, 03:34 AM   #5
arun natarajan
Member
 
Registered: Jun 2014
Posts: 111

Original Poster
Rep: Reputation: Disabled
hi ,

done the same.


[root@node2 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
HWADDR="00:0C:29:6F:83:4B"
MTU="1500"
NM_CONTROLLED="yes"
ONBOOT="yes"
IPADDR=192.168.1.52
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=192.168.1.51
#DOMAIN=node1.cluster.com
[root@node2 ~]#
 
  


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
Nslookup working but ping not working at windows client boby.kumar Linux - Server 15 03-05-2014 03:52 PM
unable to nslookup the local machine marklamers Linux - Newbie 3 01-10-2013 04:37 PM
Cannot nslookup the DNS server from client pc ! shipon_97 Linux - Newbie 2 04-22-2009 05:49 AM
nslookup fails from client dnsmasq fipeso Linux - Networking 0 10-02-2005 08:04 AM
nslookup not working on client machines only nbarraud *BSD 3 11-25-2004 01:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:38 PM.

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