LinuxQuestions.org
Help answer threads with 0 replies.
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 02-03-2014, 04:18 PM   #1
vincix
Member
 
Registered: Feb 2011
Distribution: Centos 6.7, 7
Posts: 589

Rep: Reputation: 52
troubleshooting a simple dns server connection


I have a PC on a CentOS on which I've installed bind 9. I can run the server and I can ping the respective domains from within the server. So now I simply want to connect with my mac to that dns server so that I have access to my twon domains. The PC and the Mac are connected through a normal syslink router, which does NAT. The Mac is connected through wi-fi.
So what I did was to go my mac's network - chose the wless network - advanced and added the local DNS server ip, which is 192.168.107.
It doesn't work, I cannot ping to the respective domains. I know that the modification was applied because I don't have access the other dns servers, so that was the only dns ip added. So I'm trying to troubleshoot the problem. What should I start with? How do I know where the traffic is going when I try to ping www.vinci.rr, for instance? And if the traffic is routed to the dns server, how can I see that and how should I solve the errors? etc., etc. I hope you can help.
This is my named.conf file:

Quote:
options {
listen-on { 127.0.0.1; 192.168.1.107; };
allow-query { any; };
};

zone vinci.rr in { type master; file "/var/named/vinci.rr"; };

zone lethargos.rr in { type master; file "/var/named/lethargos.rr"; };

Last edited by vincix; 02-03-2014 at 04:20 PM.
 
Old 02-03-2014, 05:26 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,412

Rep: Reputation: Disabled
You start by querying the name server directly, with nslookup. This tool is available on both Linux and Windows, and I'd be surprised if MacOS with its BSD roots didn't have it as well. The syntax is as follows:
Code:
nslookup <name> <server>
In your case, <name> is any random external DNS name (like www.linuxquestions.org) or a name in an internal zone, and <server> is the IP address of the Linux server (192.168.1.107). If there's a name resolution error, nslookup will be a bit more specific than, say, ping.

The default for nslookup is to resolve address (A) records. If you want to check other records, you can use the "-q=" parameter. For instance, to see if the domain "vinci.rr" is registered at all, check the Start of Authority (SOA) record:
Code:
nslookup -q=SOA vinci.rr 192.168.1.107
The response will tell you if the server knows of the domain, and if so, whether it believes it's the primary name server for it.
Quote:
Originally Posted by vincix View Post
This is my named.conf file:
Code:
options {
listen-on { 127.0.0.1; 192.168.1.107; };
allow-query { any; };
};

zone vinci.rr in { type master; file "/var/named/vinci.rr"; };

zone lethargos.rr in { type master; file "/var/named/lethargos.rr"; };
(I changed the QUOTE tags to CODE tags in the text above.)

Your named.conf contains neither root hints nor forwarder settings. It will not be able to resolve names on the public Internet.

Could you post the contents of the files /var/named/vinci.rr and /var/named/lethargos.rr?
 
Old 02-03-2014, 06:02 PM   #3
vincix
Member
 
Registered: Feb 2011
Distribution: Centos 6.7, 7
Posts: 589

Original Poster
Rep: Reputation: 52
Hello and thank you for your response,

The reason why I didn't configure the named.conf properly is that I only wanted to get a dns response from an exterior host (my mac).
First of all I'll give you the content of vinci.rr, as I'm only trying to simply make an exterior connection to my DNS server.

Code:
$TTL    86400;
$ORIGIN vinci.rr.
@       IN              SOA     ns1     hostmaster.vinci.rr.    (
                                2014012801; serial
                                10800; refresh
                                3600; retry
                                604800; expire
                                86400; minimum
                                )
        IN      NS      ns1 ; in the domain

ns1     IN      A       192.168.1.107;
www     IN      A       192.168.1.107;
@       IN      A       192.168.1.107;
I tried $nslookup vinci.rr 192.168.1.107, but I received this error:
Code:
;; connection timed out; no servers could be reached
So something must be blocking the dns connection somehow. Given that I started Bind with the -g option, I'd have expected some kind of log feedback, such as when I ping from the PC (where bind is installed) itself. So I suppose Bind doesn't receive any package, something else is blocking the path. So what could it be?

P.S. I checked /etc/resolv.conf from my mac and I'm pretty sure the IP written there is the correct one (I tried both changing the dns server ip through the gui network and editing the file directly). Just so you know, I do have ping response, as I'm connecting to it through ssh

Last edited by vincix; 02-03-2014 at 06:08 PM.
 
Old 02-04-2014, 02:36 AM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,412

Rep: Reputation: Disabled
Try running nslookup on the server itself. That will tell you if the problem is related to the BIND configuration or if incoming DNS requests are being blocked by a firewall rule:
Code:
nslookup -q=SOA vinci.rr 192.168.1.107
nslookup -q=SOA vinci.rr 127.0.0.1
 
Old 02-04-2014, 03:05 AM   #5
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 80
and do fetch the logs, when it tries to connect logs should have something to catch up:
Code:
tail -f /var/log/named.log
 
Old 02-04-2014, 07:14 AM   #6
vincix
Member
 
Registered: Feb 2011
Distribution: Centos 6.7, 7
Posts: 589

Original Poster
Rep: Reputation: 52
Something awkward came up meanwhile. I cannot connect through ssh anymore. It says: connection refused. I have two macs and I've tried from both of them but it's the same. However, I have installed iTerminal on my iPhone and it somehow works! I really can't make head or tails of it. Can you help me out with that before continuing with the dns server connection problems?
What should I be looking for now, how do I proceed to troubleshooting?

Thanks

But if we're at it, I did use the nslookup commands on the server, and it all seems fine (more or less ):
Code:
vinci.rr
	origin = ns1.vinci.rr
	mail addr = hostmaster.vinci.rr
	serial = 2014012801
	refresh = 10800
	retry = 3600
	expire = 604800
	minimum = 86400

Last edited by vincix; 02-04-2014 at 07:20 AM.
 
Old 02-05-2014, 01:33 AM   #7
vincix
Member
 
Registered: Feb 2011
Distribution: Centos 6.7, 7
Posts: 589

Original Poster
Rep: Reputation: 52
Is that how this forum works? There's a slight boost of posts at the beginning and then everybody loses interest because they suppose the problem has solved by itself? Really nice.
 
Old 02-05-2014, 01:43 AM   #8
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,412

Rep: Reputation: Disabled
You now seem to have a completely different problem (not being able to connect via SSH). This means the thread title no longer matches the question(s) you're asking, and hence will not attract the attention of forum users able and willing to help you troubleshoot your network issues.

Besides helping people get in touch with others in order to get help with their immediate Linux-related problems, this forum is also supposed to work as an archive. Ideally, future users with similar problems should be able to find old threads describing the problem and its solution. For this to work, threads need to stay on topic and have titles indicating the nature of the problem being discussed.

I recommend you start a new thread, and then return to this one once the SSH issue has been resolved.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] simple DNS server problem vincix Linux - Newbie 5 01-29-2014 05:29 AM
simple DNS server (dnsmasq) with Windows hosts? Umanga Linux - Server 3 07-29-2011 08:17 AM
LXer: DNS Part 1: Introduction and a Simple Server LXer Syndicated Linux News 0 12-14-2007 09:00 AM
Troubleshooting DNS opsraja Linux - Networking 1 02-24-2005 03:29 AM


All times are GMT -5. The time now is 05:25 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration