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 07-20-2017, 10:47 AM   #1
Freki
LQ Newbie
 
Registered: Jul 2017
Posts: 2

Rep: Reputation: Disabled
DNS-Server cant be reached (TCP-Issue?)


Hey Community,

First of all, Sorry for my english.
Im facing a problem with DNS on my Redhatservers.
I have 2 Servers which should use 8.8.8.8 as DNS-Server
both resolv.conf are showing this:

Quote:
Nameserver 8.8.8.8
ping to this server works, but i cant resolve any hostnames.
So i tried to do a netcat on port 53 to 8.8.8.8:

Code:
# nc -s 10.1.33.67 -v 8.8.8.8 53
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Connection refused.
As u can see, this doesnt work.
If i use the -u option (UDP), it works fine:

Code:
# nc -u  -s 10.1.33.67 -v 8.8.8.8 53
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Connected to 10.1.33.67:53.
So i tried it between my 2 Servers:

Code:
nc -u  -s 10.1.33.67 -v 10.1.33.80 53
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Connected to 10.1.33.80:53.
# nc -s 10.1.33.67 -v 10.1.33.80 53
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Connection refused.

If i try the same way between both servers, i also get a refused without the -u option. If i use it, both servers connect fine. Iptables dont have any rules by now, so this cant be the trigger.

So why is netcat not possible per default (TCP) and could this be the reason, why i cant use the DNS?

Thanks a lot!
 
Old 07-20-2017, 12:12 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
I can confirm that 8.8.8.8 is responding on TCP port 53 from here.

Presumably 10.1.33.67 is one IP on the server you're testing from?

By default iptables allows OUTBOUND connections so you would have had to create a rule prohibiting port 53 (or allowing only certain ports while prohibition all others). If iptables isn't running it isn't your problem.

You probably have something upstream of the server (e.g. a switch, a router or your ISP) that is blocking tcp port 53 to 8.8.8.8.

For you to be able to connect to port 53 on one your internal servers from another internal you would need that server to be LISTENing on port 53 and have that server's iptables allowing port 53. You don't mention your internal servers being DNS servers in and of themselves so it isn't clear if they are. If the server IS listening on port 53 AND iptables isn't blocking it then again it is likely your router or switch or ISP is blocking the traffic.
 
Old 07-21-2017, 03:22 AM   #3
Freki
LQ Newbie
 
Registered: Jul 2017
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks for the reply,

Quote:
Presumably 10.1.33.67 is one IP on the server you're testing from?
Yep one is the .67 and one the 80.

Quote:
# nc -u -s 10.1.33.67 -v 8.8.8.8 53
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Connected to 10.1.33.67:53.
that was just a copy paste mistake... should be:

# nc -u -s 10.1.33.67 -v 10.1.33.80 53
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Connected to 10.1.33.80:53.

Quote:
For you to be able to connect to port 53 on one your internal servers from another internal you would need that server to be LISTENing on port 53 and have that server's iptables allowing port 53
I just did. a nc -l (listen) on the servers to check. Otherwise i wouldnt have got an answer. As i said, IP-Tables dont have any rules.

I also thought, there is something in the network configuration. Sadly those are hosted Servers, so it seems like i need to write the Hoster-


But anyway thanks. Your Post helped me a lot
 
1 members found this post helpful.
  


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
DNS Internal/External Views - No servers could be reached dansdionne Linux - Server 17 07-27-2015 05:29 PM
[SOLVED] DNS server could not be reached milind_bhavsar Red Hat 5 04-15-2012 11:05 PM
DNS- No servers could be reached edgambite Linux - Networking 30 11-05-2008 08:34 PM
DNS issue - DNS works perfect on server but not on any other computer jtneal Linux - Networking 3 03-15-2008 03:30 PM
DNS: connection timed out; no servers could be reached ubu_roi Linux - Networking 1 04-13-2005 11:45 AM

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

All times are GMT -5. The time now is 08:47 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