LinuxQuestions.org
Register a domain and help support LQ
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
 
LinkBack Search this Thread
Old 11-04-2012, 03:17 PM   #1
dbtech
LQ Newbie
 
Registered: Nov 2012
Location: Birmingham
Distribution: RedHat, CentOS, Oracle Linux
Posts: 8

Rep: Reputation: Disabled
Unhappy Name resolution is only working from server side. Clients cannot resolve host names.


Hi Folks,

Could anyone please point me to the right direction as I have spent so much time on this without luck.

I have installed Bind on my CentOS 5 server for internal network. The name resolution is working from the server itself only but not from the clients.

--------------
ping ip from server to client machine => OK
ping ip from client to server machine => OK

ping hostname from server to client machine => OK
ping hostname from client to server machine => unknown host
--------------

Server1 [cent3 - CentOS 5] = eth1 "10.0.1.101" Bind 9 installed on CentOS 5
Client1 [odd1 - Oracle Linux 6] = eth1 "10.0.1.101" Oracle Linux 6
Client2 [odd2 - Oracle Linux 6] = eth1 "10.0.1.102" Oracle Linux 6
------------

resolv.conf (Server cent3)

; generated by /sbin/dhclient-script
search simtafco.com
nameserver 10.0.1.100

------------

resolv.conf (Client1 odd1)

; generated by /sbin/dhclient-script
search simtafco.com
nameserver 10.0.1.100

------------

named.conf (Server cent3)

options {
listen-on { any; } ;
directory "/var/named"; // the default
version "Nope";
allow-recursion { any; };
};

zone "simtafco.com" in {
type master;
file "simtafco.com" ;
};

------------

zone file simtafco.com (Server cent3)

@ IN SOA cent3.simtafco.com. admin.simtafco.com. (
2010062801 ; Serial
10800 ; Refresh
3600 ; Expire
86400 ; Minimum
)

simtafco.com. IN NS cent3.simtafco.com.

simtafco.com. IN A 10.0.1.100
odd1.simtafco.com IN A 10.0.1.101
odd2.simtafco.com IN A 10.0.1.102

------------

Thank you.

Last edited by dbtech; 11-04-2012 at 05:24 PM. Reason: mistyped
 
Old 11-04-2012, 05:11 PM   #2
dbtech
LQ Newbie
 
Registered: Nov 2012
Location: Birmingham
Distribution: RedHat, CentOS, Oracle Linux
Posts: 8

Original Poster
Rep: Reputation: Disabled
Any help appreciated.

Last edited by dbtech; 11-04-2012 at 05:15 PM. Reason: mistyped
 
Old 11-05-2012, 06:10 AM   #3
ayush.jain
LQ Newbie
 
Registered: Oct 2012
Location: India
Distribution: SUSE
Posts: 9

Rep: Reputation: Disabled
I suspect the route is not added in your client machine for default gateway.
Please check using:
Code:
route -n
Check for the default gateway..
 
Old 11-05-2012, 11:03 AM   #4
dbtech
LQ Newbie
 
Registered: Nov 2012
Location: Birmingham
Distribution: RedHat, CentOS, Oracle Linux
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks Ayush. This is the output of route -n. Any ideas please ?

Kernel IP routing table
Quote:
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 10.0.2.2 0.0.0.0 UG 0 0 0 eth0

My server and client ip addresses are as following:

Server1 [cent3 - CentOS 5] = eth1 "10.0.1.101" Bind 9 installed on CentOS 5
Client1 [odd1 - Oracle Linux 6] = eth1 "10.0.1.101" Oracle Linux 6
Client2 [odd2 - Oracle Linux 6] = eth1 "10.0.1.102" Oracle Linux 6

Last edited by dbtech; 11-05-2012 at 11:06 AM.
 
Old 11-05-2012, 12:00 PM   #5
ayush.jain
LQ Newbie
 
Registered: Oct 2012
Location: India
Distribution: SUSE
Posts: 9

Rep: Reputation: Disabled
I think we are quite near to the problem.
If am right, you would be able to ping the nameserver ip i.e. 10.0.1.100 from the server machine i.e 10.0.1.101 but not from the client machine i.e. 10.0.1.102 as problem is only with DNS resolution

So let's say you have client 1 (C1), client 2 (C2) and a nameserver (D1).
What am suspecting is C1 is able to reach D1 while C2 can't ping D1. Please correct me if am wrong.

For that you can try adding default route on C2 to reach D1
e.g. route add default gw <ip/of/your/default/gateway>
 
Old 11-05-2012, 11:49 PM   #6
ayush.jain
LQ Newbie
 
Registered: Oct 2012
Location: India
Distribution: SUSE
Posts: 9

Rep: Reputation: Disabled
Also, I hope that you have added the resolv.conf for client 2 odd2 as well similar to client1 odd1.
Only problem I see here is Client2 not able to reach 10.0.1.100. Could be 2 reasons:
1) Resolv.conf not configured on Client2
2) Resolv.conf configured but not able to ping nameserver (for that I suggested adding default route to your gateway), because as you said things work from Client 1, but not from Client2
 
Old 11-06-2012, 05:27 AM   #7
dbtech
LQ Newbie
 
Registered: Nov 2012
Location: Birmingham
Distribution: RedHat, CentOS, Oracle Linux
Posts: 8

Original Poster
Rep: Reputation: Disabled
Ayush,

These three machines are on the "same" subnet.

>"Both" C1 and C2 can ping the nameserver D1's ip address (which has got bind installed)
>D1 can ping ip addresses of both C1 and C2
>D1 can ping hostnames of both C1 and C2

>Both C1 and C2 cannot ping host name of D1 DNS/nameserver.
>Both C1 and C2 cannot ping host name of each other.

Also resolv.conf has got the D1 nameserver address in both C1 and C2 as I have shown in the first thread. So if C1 is able to ping hostname of D1 then C2 will work as well.

I used C1 in example as both C1 and C2 are exactly same except the hostname and ip address.

Last edited by dbtech; 11-06-2012 at 05:28 AM.
 
Old 11-06-2012, 06:10 AM   #8
ayush.jain
LQ Newbie
 
Registered: Oct 2012
Location: India
Distribution: SUSE
Posts: 9

Rep: Reputation: Disabled
Strange..
Should have worked then..

Did you try using ethereal/wireshark for the question/answer section of DNS query sent from clients?
Or instead you can try:
Code:
dig A odd1.simtafco.com
or, nslookup -q=A odd1.simtafco.com
This way you would be able to verify whether the request is going to D1 or not and if going, what's the answer section?
Also, you can try comparing the output of same command from server from where resolution is working as you stated.
 
Old 11-06-2012, 09:56 AM   #9
dbtech
LQ Newbie
 
Registered: Nov 2012
Location: Birmingham
Distribution: RedHat, CentOS, Oracle Linux
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks for your reply.

I think I will need to make sure that BIND configuration was fine. So going to re-install and configure to make sure I did not miss anything. Will post the results soon.
 
Old 11-09-2012, 11:08 AM   #10
dbtech
LQ Newbie
 
Registered: Nov 2012
Location: Birmingham
Distribution: RedHat, CentOS, Oracle Linux
Posts: 8

Original Poster
Rep: Reputation: Disabled
This time I did not install the bind-chroot package and used the standard bind. However, I hit exactly the same issue. [can ping ip addresses in all directions but hostname ping only works from server]. So I checked the udp/tcp port 53 but did not find them in netstat -an. I issued the following commands as found in google and did /etc/init.d/iptables restart but no joy. So looks like this might be the issue why my clients cannot reach the dns server. Any ideas on how to open udp and tcp port 53 please (CentOS 5)?

iptables -A INPUT -p tcp -m tcp --sport 53 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
iptables -A INPUT -p udp -m udp --sport 53 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -m tcp --sport 1024:65535 --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p udp -m udp --sport 1024:65535 --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT

Last edited by dbtech; 11-09-2012 at 11:09 AM.
 
Old 11-11-2012, 01:01 PM   #11
dbtech
LQ Newbie
 
Registered: Nov 2012
Location: Birmingham
Distribution: RedHat, CentOS, Oracle Linux
Posts: 8

Original Poster
Rep: Reputation: Disabled
Smile [RESOLVED] Name resolution is only working from server side. Clients cannot resolve host names.

Hi Everyone,

I have resolved the issue as far as DNS is concerned. I turned off the iptables by running command "service iptables stop" ... and there it was .. all clients started pinging the hostname of DNS Server. So looks like there is some issue with iptables configuration. Unfortunately I am not very good at iptables so will research more into that and will start a new thread if required. Thanks all for your ideas and contributions.
 
Old 11-12-2012, 06:52 AM   #12
root@linux
LQ Newbie
 
Registered: Aug 2011
Location: Pakistan
Distribution: Ubuntu
Posts: 11

Rep: Reputation: Disabled
did you try to add a line in /etc/hosts file? such as

hostname 127.0.0.1 or 10.0.0.1
 
Old 11-12-2012, 08:09 AM   #13
dbtech
LQ Newbie
 
Registered: Nov 2012
Location: Birmingham
Distribution: RedHat, CentOS, Oracle Linux
Posts: 8

Original Poster
Rep: Reputation: Disabled
127.0.0.1 is already available in /etc/hosts on all three machines for the loopback purpose.
 
Old 11-12-2012, 05:47 PM   #14
DutchGeek
Member
 
Registered: Sep 2006
Distribution: SuSE, Slackware
Posts: 51

Rep: Reputation: 4
Quote:
My server and client ip addresses are as following:

Server1 [cent3 - CentOS 5] = eth1 "10.0.1.101" Bind 9 installed on CentOS 5
Client1 [odd1 - Oracle Linux 6] = eth1 "10.0.1.101" Oracle Linux 6
Client2 [odd2 - Oracle Linux 6] = eth1 "10.0.1.102" Oracle Linux 6
Quote:
These three machines are on the "same" subnet.
is 10.0.1.101 shared by server1 and client1? that's not good..

For the iptables issue, use:
Code:
iptables -L -vv
to see your rules

to log which packets are dropped by iptables:

Code:
iptables -N LOGGING
iptables -A INPUT -j LOGGING
iptables -A LOGGING -m limit --limit 2/min -j LOG --log-prefix "IPTables-Dropped: " --log-level 4
iptables -A LOGGING -j DROP
then tail -f /var/log/messages
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DNS server not able to resolve host names to IP adresses Shiva Pahwa Linux - Server 4 08-07-2012 12:35 PM
DNS server not able to resolve host names to IP adresses Shiva Pahwa Linux - Server 3 06-22-2012 03:53 AM
Not able to resolve domain names, ping <hostname1> o/p: unknown host tirtha1987 Linux - Networking 4 10-08-2011 06:39 AM
Check if computer can resolve host names MicahCarrick Programming 3 01-02-2007 10:48 PM
Can bind 9 (DNS) resolve names based on who's asking?? (internal vs. external clients registering Linux - Networking 3 06-16-2004 07:25 AM


All times are GMT -5. The time now is 01:47 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration