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 11-08-2017, 03:07 AM   #1
ddenial
Member
 
Registered: Dec 2016
Distribution: CentOS, Fedora, Ubuntu
Posts: 56

Rep: Reputation: Disabled
Need Help to resolve confusion on reverse lookup in bind server


Hello

I am trying to install authoritative bind server for my two zones. The first zone is for lookups on my local LAN and another zone for virtual machines in KVM. Bind server is installed in localhost.

Zone1: hostdomain.lan
Network: 192.168.1.0/24
DNS Server IP: 192.168.1.10 (ns.hostdomain.lan)

Zone2: kvmdomain.lan
Network: 192.168.124.0/24
DNS Server IP: 192.168.1.10 (in ns.hostdomain.lan)

Following are my config files:

/etc/resolv.conf (ns.hostdomain.lan)
Code:
search hostdomain.lan kvmdomain.lan
nameserver 192.168.1.10
/etc/named.conf
Code:
listen-on port 53 { 127.0.0.1; 192.168.1.10; };
allow-query { localhost; 192.168.1.0/24; 192.168.124.0/24; };
recursion no;

zone "hostdomain.lan" IN {
  type master;
  file "hostdomain.lan.fwd";
  allow-update { none; };
};

zone "1.168.192.in-addr.arpa" IN {
  type master;
  file "hostdomain.lan.rev";
  allow-update { none; };
};

/*
zone "kvmdomain.lan" IN {
  type master;
  file "kvmdomain.lan.fwd";
  allow-update { none; };
};

zone "124.168.192.in-addr.arpa" IN {
  type master;
  file "kvmdomain.lan.rev";
  allow-update { none; };
};
hostdomain.lan.fwd
Code:
$TTL 3d
$ORIGIN hostdomain.lan.

@ IN SOA ns.hostdomain.lan. admin.hostdomain.lan ( 1 12h 15m 3w 3h )
@ IN NS ns.hostdomain.lan.
ns  IN A 192.168.1.10

rtr IN A 192.168.1.1
mob IN A 192.168.1.3
prn IN A 192.168.1.4
hostdomain.lan.rev
Code:
$TTL 3d
$ORIGIN 1.168.192.in-addr.arpa.

@ IN SOA ns.hostdomain.lan. admin.hostdomain.lan. ( 1 12h 15m 3w 3h )
@ IN NS  ns.hostdomain.lan.
10 IN PTR ns.hostdomain.lan.

1  IN PTR rtr.hostdomain.lan.
3  IN PTR mob.hostdomain.lan.
4  IN PTR prn.hostdomain.lan.
So far so good. It is working. The confusion to me is on how to write zone files for kvmdomain.lan.

kvmdomain.lan.fwd
Code:
$TTL 3d
$ORIGIN kvmdomain.lan.

@ IN SOA ns.hostdomain.lan. admin.hostdomain.lan. ( 1 12h 15m 3w 3h )
@ IN NS ns.hostdomain.lan.
ns.hostdomain.lan. IN A 192.168.1.10

vm2 IN A 192.168.124.2
vm3 IN A 192.168.124.3
vm4 IN A 192.168.124.4
kvmdomain.lan.rev
Code:
$TTL 3d
$ORIGIN 124.168.192.in-addr.arpa.

@ IN SOA ns.hostdomain.lan. admin.hostdomain.lan. ( 1 12h 15m 3w 3h )
@ IN NS ns.hostdomain.lan.
192.168.1.10. IN PTR ns.hostdomain.lan.

2 IN PTR vm2.kvmdomain.lan.
3 IN PTR vm3.kvmdomain.lan.
4 IN PTR vm4.kvmdomain.lan.
Config file checks

hostdomain.lan
Code:
# named-checkzone hostdomain.lan hostdomain.lan.fwd
zone hostdomain.lan/IN: loaded serial 1
OK

# named-checkzone 1.168.192.in-addr.arpa hostdomain.lan.rev
zone 1.168.192.in-addr.arpa/IN: loaded serial 1
OK
kvmdomain.lan
Code:
# named-checkzone kvmdomain.lan kvmdomain.lan.fwd
kvmdomain.lan.fwd:#: ignoring out-of-zone data (ns.localdomain.lan)
zone kvmdomain.lan/IN: loaded serial 1
OK

# named-checkzone 124.168.192.in-addr.arpa kvmdomain.lan.rev
kvmdomain.lan.rev:#: ignoring out-of-zone data (192.168.1.10)
zone 124.168.192.in-addr.arpa/IN: loaded serial 1
OK
What am I doing wrong? How to properly write zone files where DNS server is not in that zone but resides in another zone.

Any help is really appreciated.

Thanks
 
Old 11-08-2017, 06:40 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,214

Rep: Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683
Quote:
kvmdomain.lan.rev

$TTL 3d
$ORIGIN 124.168.192.in-addr.arpa.

@ IN SOA ns.hostdomain.lan. admin.hostdomain.lan. ( 1 12h 15m 3w 3h )
@ IN NS ns.hostdomain.lan.
192.168.1.10. IN PTR ns.hostdomain.lan.

2 IN PTR vm2.kvmdomain.lan.
3 IN PTR vm3.kvmdomain.lan.
4 IN PTR vm4.kvmdomain.lan.

# named-checkzone 124.168.192.in-addr.arpa kvmdomain.lan.rev
kvmdomain.lan.rev:#: ignoring out-of-zone data (192.168.1.10)
zone 124.168.192.in-addr.arpa/IN: loaded serial 1
OK

What am I doing wrong? How to properly write zone files where DNS server is not in that zone but resides in another zone.
You don't need to put "192.168.1.10 IN PTR ns.hostdomain.lan." into the 124.168.192.in-addr.arpa zonefile.
Using the NS RR, the authoritative nameserver that resides in a different domain, will be resolved from the authoritative dns of that domain.

In your case, if you want to lookup for example 192.168.124.2, your query will be directed to ns.hostdomain.lan (authoritative for 124.168.192.in-addr.arpa).
This hostname will be resolved by ns.hostdomain.lan (authoritative for hostdomain.lan) using the zonefile hostdomain.lan and finally your client will ask 192.168.1.10 and get the response.

Regards
 
1 members found this post helpful.
Old 11-08-2017, 07:09 AM   #3
ddenial
Member
 
Registered: Dec 2016
Distribution: CentOS, Fedora, Ubuntu
Posts: 56

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
You don't need to put "192.168.1.10 IN PTR ns.hostdomain.lan." into the 124.168.192.in-addr.arpa zonefile.
Using the NS RR, the authoritative nameserver that resides in a different domain, will be resolved from the authoritative dns of that domain.

In your case, if you want to lookup for example 192.168.124.2, your query will be directed to ns.hostdomain.lan (authoritative for 124.168.192.in-addr.arpa).
This hostname will be resolved by ns.hostdomain.lan (authoritative for hostdomain.lan) using the zonefile hostdomain.lan and finally your client will ask 192.168.1.10 and get the response.

Regards
As you suggested I removed NS A and PTR record from both kvmdomain.lan.fwd and kvmdomain.lan.rev zone files and it is resolving perfectly.

Thank you very very much.

Last edited by ddenial; 11-08-2017 at 07:11 AM.
 
  


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] DNS doesn't resolve reverse lookup Giving Error "server can not find x.xx.xx.in-addr.arpa.:NXDOMAIN" amulya_lky Linux - Server 1 10-31-2017 04:14 PM
Bind reverse lookup mattyg007 Linux - Networking 1 12-08-2011 12:11 PM
BIND-reverse lookup doesn't work-lame server pthegreat Linux - Server 15 02-18-2010 11:48 AM
[SOLVED] bind reverse zone; no name with reverse lookup deadeyes Linux - Server 3 10-12-2009 09:54 AM
Bind reverse lookup Kostko Linux - Networking 2 12-07-2002 09:06 AM

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

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