LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-01-2010, 01:42 PM   #16
MheAd
Member
 
Registered: Jun 2007
Distribution: Ubuntu 14.04
Posts: 186

Original Poster
Rep: Reputation: 36

Quote:
Originally Posted by bathory View Post
Yes it goes out to ask for the ip.
Could you post the named.conf of server2?
What is the query line in the log?
Also what's in /etc/resolv.conf?
Of course I could post - I really appreciate YOU taking YOUR time to help me out!


How is that "query" supposed to look like?
I'm not able to find anything in the log (severity level debug).

resolv.conf of the server2 is configured so it uses itself for queries, the DNS-master of sub.domain.xx it is.

search sub.domain.xx
address 172.16.0.100 (IP address that server2 DNS listens on)

named.conf of server2.
It's nothing fancy, really...I just need this simple setup for some DNSSec-experiments that I will be implementing as soon as I've solved this issue

Code:
options {

        directory "/var/named";
        statistics-file         "data/named_stats.txt";
        memstatistics-file      "data/named_mem_stats.txt";

        listen-on { 172.16.0.100; };

};

logging {

        channel logfile {
        file "/var/log/logfile" versions 3 size 10m;
        print-time yes;
        print-severity yes;
        print-category yes;
        severity debug;
        };

        category default {logfile;};
};

zone "." in {
        type hint;
        file "named.root";
};



zone "localhost" in {
        type master;
        file "localhost";
};

zone "0.0.127.IN-ADDR.ARPA" in {
        type master;
        file "localhost.rev";
};

zone "sub.domain.xx" in {
        type master;
        file "sub.domain.xx.master";

};

zone "64/26.0.16.172.IN-ADDR.ARPA" in {
        type master;
        file "sub.domain.xx.rev";
};
 
Old 04-01-2010, 02:03 PM   #17
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
You don't have a category queries, that's why you don't get the query line in logs. You have to add:
Code:
category queries { logfile;};
Just a silly question: Are you increasing the serial after making changes?
 
Old 04-01-2010, 02:11 PM   #18
MheAd
Member
 
Registered: Jun 2007
Distribution: Ubuntu 14.04
Posts: 186

Original Poster
Rep: Reputation: 36
Following query-rows get printed when I do 'host 172.16.0.101 (from server2 directly)

Code:
01-Apr-2010 21:08:28.959 queries: info: client 172.16.0.100#42018: query: 101.0.16.172.in-addr.arpa IN PTR +
01-Apr-2010 21:08:30.429 queries: info: client 172.16.0.100#33561: query: 101.0.16.172.in-addr.arpa IN PTR +
I'm not increasing serial (in zones) due the fact that I'm not running any zone-transfers / got no slaves currently.
 
Old 04-01-2010, 02:19 PM   #19
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
Increase the serial for 64/26.0.16.172.IN-ADDR.ARPA (it's a master server after all), because NXDOMAIN means that there is no 172.16.0.101. The fact is to know which dns gives that response.
For this it's better use dig instead of host and (optionally) use your dns IP:
Code:
dig -x 172.16.0.101 @172.16.0.100
 
Old 04-01-2010, 02:23 PM   #20
MheAd
Member
 
Registered: Jun 2007
Distribution: Ubuntu 14.04
Posts: 186

Original Poster
Rep: Reputation: 36
I already increased serials while waiting for your reply. And no use.
Also, when using dig - I'm getting more extensive, but very weird results...

Code:
[root@centos-server2 named]# dig -x 172.16.0.101 @172.16.0.100

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.2 <<>> -x 172.16.0.101 @172.16.0.100
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 25605
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

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

;; AUTHORITY SECTION:
16.172.in-addr.arpa.	300	IN	SOA	prisoner.iana.org. hostmaster.root-servers.org. 2002040800 1800 900 604800 604800

;; Query time: 122 msec
;; SERVER: 172.16.0.100#53(172.16.0.100)
;; WHEN: Thu Apr  1 21:21:34 2010
;; MSG SIZE  rcvd: 120
Where did it get that from?!

It obviously queries ROOT servers which makes me think that this is the only way it does the things and since this is virtual environment, with private addresses, it cannot be done. I mean, if it must query for the server that is authoritative for the entire 172.16.0.0/24 range, it cannot possibly know of existance of the domain.xx which is one level above itself - thus the reason why it queries the ROOT-section for the answer.

Last edited by MheAd; 04-01-2010 at 02:26 PM.
 
Old 04-01-2010, 02:34 PM   #21
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
It's the default for a private address if it cannot be resolved. I get the same answer and I don't have a dns for the 172.16.0.0 network.
Sorry I've to leave for a couple of hours, so I'll look to it later.

Regards
 
Old 04-01-2010, 02:36 PM   #22
MheAd
Member
 
Registered: Jun 2007
Distribution: Ubuntu 14.04
Posts: 186

Original Poster
Rep: Reputation: 36
Ok, have a nice day and thanks for all your effort so far - I'll keep digging into it until I hear again from you (or manage to solve the problem myself).

Regards.
 
Old 04-01-2010, 06:00 PM   #23
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
Hi again,

I've done the same setup as you for my 192.168.0.0/24 network and it worked as expected.
Maybe there is another typo. I've looked very carefully the files you've posted and I didn't find anything, but you should take a look also.
Also are you sure that centos-server1.domain.xx can resolve centos-server2.sub.domain.xx IP address?
 
Old 04-02-2010, 05:40 AM   #24
MheAd
Member
 
Registered: Jun 2007
Distribution: Ubuntu 14.04
Posts: 186

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by bathory View Post
Hi again,

I've done the same setup as you for my 192.168.0.0/24 network and it worked as expected.
Maybe there is another typo. I've looked very carefully the files you've posted and I didn't find anything, but you should take a look also.
Also are you sure that centos-server1.domain.xx can resolve centos-server2.sub.domain.xx IP address?
Hi again!

I'm not finding any typos.
Yes, centos-server1.domain.xx can resolve centos-server2.sub.domain.xx and anything else inside of that subdomain.
Only hosts in the actual sub.domain.xx cannot do reversed lookups on anything.
Because of the setup, I was aware that the sub.domain.xx was unable to resolve anything from domain.xx (because it doesn't know of its existance, and it cannot find domain.xx via ROOT servers as the domain is fake - to be able to do this, I would need to add centos-server1.domain.xx as forwarder for that zone, inside of server2, named.conf) but I was expecting them to be able to resolve (reversed) addresses inside its own domain thanks to the PTR records of the actual sub.domain.xx server. Yet it goes out to ROOT servers and do the lookup and then fails, of course.

I'll need to read more about delegation-theory.
If one of your previous statements is correct (about delegation) then queries to ROOT servers are necessary too, from delegated zones point of view, when a reversed lookup is done - and then I wont be able to do this in virtual environment and you shouldn't be able either, with your setup, unless there is a missunderstanding here between my problem and your solution.

Last edited by MheAd; 04-02-2010 at 06:13 AM.
 
Old 04-02-2010, 07:44 AM   #25
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:
Because of the setup, I was aware that the sub.domain.xx was unable to resolve anything from domain.xx (because it doesn't know of its existance, and it cannot find domain.xx via ROOT servers as the domain is fake - to be able to do this, I would need to add centos-server1.domain.xx as forwarder for that zone, inside of server2, named.conf) but I was expecting them to be able to resolve (reversed) addresses inside its own domain thanks to the PTR records of the actual sub.domain.xx server. Yet it goes out to ROOT servers and do the lookup and then fails, of course.
So, if I understand correct server2.sub.domain.xx cannot resolve hosts of domain.xx (like centos-server1.domain.xx).
When some client tries to resolve 172.16.0.101, the query goes to server1, that in turns finds out that this subnet is delegated to server2.subdomain, gives this response to client, the client asks server2.subdomain and server2.subdomainas tries to ask server1 that is authoritative for the 172.16.0.0 network, but it cannot resolve server1 IP (am I correct?) and goes to ROOT server to find out.
I think that you have 2 possibilities to go:
You can use IPs instead of host names in the NS records of the zone files, or add forwarders for domain.xx (you said...).
 
Old 04-02-2010, 01:34 PM   #26
MheAd
Member
 
Registered: Jun 2007
Distribution: Ubuntu 14.04
Posts: 186

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by bathory View Post
So, if I understand correct server2.sub.domain.xx cannot resolve hosts of domain.xx (like centos-server1.domain.xx).
When some client tries to resolve 172.16.0.101, the query goes to server1, that in turns finds out that this subnet is delegated to server2.subdomain, gives this response to client, the client asks server2.subdomain and server2.subdomainas tries to ask server1 that is authoritative for the 172.16.0.0 network, but it cannot resolve server1 IP (am I correct?) and goes to ROOT server to find out.
I think that you have 2 possibilities to go:
You can use IPs instead of host names in the NS records of the zone files, or add forwarders for domain.xx (you said...).
Pretty much so, yeah. But I was aware of the limitation of sub.domain.xx not being able to resolve anything in domain.xx unless consulting the ROOT (which will result in failure due obvious reasons) or by using forwarder. I'm surprised, however, that it must do this to resolve its own reversed addresses. I mean, it's got its own ARPA-zone file with PTR records, why would it need to look first for the server that delegated it. It doesn't do that when it resolves hostnames to addresses. If I query mail.sub.domain.xx on sub.domain.xx it will use the DNS zone info on sub.domain.xx and return the 172.16.0.101 address. It's the other way around that doesn't work - reversed resolving. That's why I need to read more about the theory of delegating in-arpa to be 100% certain. Meanwhile, I'm curious how you got it working, as you wrote last night that you did an identical setup - and it worked.
 
Old 04-02-2010, 04:22 PM   #27
MheAd
Member
 
Registered: Jun 2007
Distribution: Ubuntu 14.04
Posts: 186

Original Poster
Rep: Reputation: 36
Well, I've solved the problem by adding following forwarder on my server2 (sub.domain.xx) - which goes out to server1. It is used for reversed queries - when sub.domain.xx tries to do reversed resolving on the delegated ARPA-addresses, on 172.16.0.64/26 subnet. This forces the server to go to the delegating server directly instead of querying the root zones of ARPA on the internet.

zone "0.16.172.IN-ADDR.ARPA" in {
type forward;
forward only;
forwarders { 172.16.0.10;};
};

This way, it doesn't go out on the Internet to resolve the addresses. This is very "ugly" and odd, but the only way I could make it work. I will be still reading on the ARPA-subject to fully understand this behaviour. I always thought that a DNS, that is a master over a delegated sub-domain, just like it uses its own zone-files to resolve the hosts in the domain - does the same with ARPA-addresses as well. Apparently not, and since this is virtual environment with no registrated addresses - this rule was necessary to make it work.

Anyway, I appreciate a lot for all your efforts to try to help me out, mate.

CHEERS!
 
Old 04-02-2010, 04:24 PM   #28
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
Yesterday I've left my domain name that can be resolved from ROOT servers. Now I've also used domain.xx and here is the answer from my server2 (192.168.0.77):
Quote:
dig -x 192.168.0.77

; <<>> DiG 9.7.0-P1 <<>> -x 192.168.0.77
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57169
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 1

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

;; ANSWER SECTION:
77.0.168.192.in-addr.arpa. 82894 IN CNAME 77.64/26.0.168.192.in-addr.arpa.
77.64/26.0.168.192.in-addr.arpa. 86400 IN PTR server2.sub.domain.xx.

;; AUTHORITY SECTION:
64/26.0.168.192.in-addr.arpa. 86400 IN NS server2.sub.domain.xx.

;; ADDITIONAL SECTION:
server2.sub.domain.xx. 86400 IN A 192.168.0.77
(from server 1)
Code:
dig -x 192.168.0.77

; <<>> DiG 9.7.0-P1 <<>> -x 192.168.0.77
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20335
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 0

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

;; ANSWER SECTION:
77.0.168.192.in-addr.arpa. 86400 IN     CNAME   77.64/26.0.168.192.in-addr.arpa.
77.64/26.0.168.192.in-addr.arpa. 86400 IN PTR   server2.sub.domain.xx.

;; AUTHORITY SECTION:
64/26.0.168.192.in-addr.arpa. 86400 IN  NS      server2.sub.domain.xx.
;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Apr 3 00:27:56 2010
;; MSG SIZE rcvd: 115


****EDIT****
It looks that we were posting at the same time...
Anyway I've used no forwarders, or any other hack

Last edited by bathory; 04-02-2010 at 04:30 PM.
 
Old 04-02-2010, 04:29 PM   #29
MheAd
Member
 
Registered: Jun 2007
Distribution: Ubuntu 14.04
Posts: 186

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by bathory View Post
It looks that we were posting at the same time...
Anyway I've used no forwarders, or any other hack
In that case, I get even more frustrated.
Why did it work at your end and not at mine?
Would you mind posting your entire configuration (zones + named.conf of both servers), if it's not too much trouble for you?
 
Old 04-02-2010, 04:32 PM   #30
MheAd
Member
 
Registered: Jun 2007
Distribution: Ubuntu 14.04
Posts: 186

Original Poster
Rep: Reputation: 36
PS.
I get same results just like yourself (although I'm doing it on 172.16.0.101 address in my case) but it works only with the forwarder hack (from server2 point of view - i never had problems doing this from domain above - server1).

So please post your conf. I would really appreciate it.
 
  


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 lookup doesn't work, ping, firefox will not work properly lovemov Linux - Networking 2 04-23-2009 02:30 PM
DNS lookup failed: How does /etc/resolv.conf work? kenneho Linux - Server 2 01-20-2009 06:54 AM
classless non-delegated reverse DNS Berhanie Linux - Server 0 04-18-2008 05:20 PM
Traceroute, Ping, Domain Name Server (DNS) Lookup, WHOIS, and DNS Records Lookup netoknet General 1 05-09-2005 03:43 AM
DNS Lookup do not work for Firefox rpigna Mandriva 2 04-27-2005 01:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:13 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
Open Source Consulting | Domain Registration