BIND Refusing external PTR queries

Issues related to configuring your network
Post Reply
systemshq
Posts: 20
Joined: 2015/11/11 10:58:12

BIND Refusing external PTR queries

Post by systemshq » 2016/02/23 14:26:18

I have set-up an authoratitive nameserver using BIND and for the most part it works fine. The only problem is if I do an external PTR lookup it fails with a refused error. This is important as a lot mail servers now do PTR lookups and if it fails the mail won't get sent. Any help most appreciated please. Many thanks

Code: Select all

/etc/named.conf

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
	listen-on port 53 { 127.0.0.1; 192.168.1.7; 81.187.203.150; };
  	listen-on-v6 { none; };
	directory 	"/var/named";
	dump-file 	"/var/named/data/cache_dump.db";
	statistics-file "/var/named/data/named_stats.txt";
	memstatistics-file "/var/named/data/named_mem_stats.txt";
        allow-recursion {
                127.0.0.1;
                192.168.1.0/24;
                81.187.203.128/25;
                213.138.103.94;
                };
        allow-transfer {
                127.0.0.1;
                192.168.1.0/24;
                81.187.203.128/25;
                213.138.103.94;
                };

	/* 
	 - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
	 - If you are building a RECURSIVE (caching) DNS server, you need to enable 
	   recursion. 
	 - If your recursive DNS server has a public IP address, you MUST enable access 
	   control to limit queries to your legitimate users. Failing to do so will
	   cause your server to become part of large scale DNS amplification 
	   attacks. Implementing BCP38 within your network would greatly
	   reduce such attack surface 
	*/
	# recursion yes;

	dnssec-enable yes;
	dnssec-validation yes;
	dnssec-lookaside auto;

	/* Path to ISC DLV key */
	bindkeys-file "/etc/named.iscdlv.key";

	managed-keys-directory "/var/named/dynamic";

	pid-file "/run/named/named.pid";
	session-keyfile "/run/named/session.key";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
	type hint;
	file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

zone "grinton.net" IN {
             type master;
             file "db.grinton.net";
        allow-transfer {
                81.187.81.32;
                81.187.203.131;
                81.187.203.134;
                81.187.203.128/25;
                192.168.1.0/24;
                213.138.103.94;
                };
        };
zone "hougie.co.uk" IN {
             type master;
             file "db.hougie.co.uk";
             allow-transfer {
                81.187.81.32;
                81.187.203.131;
                81.187.203.134;
                81.187.203.128/25;
                192.168.1.0/24;
                213.138.103.94;
             };
        };
zone "hougie.com" IN {
             type master;
             file "db.hougie.com";
             allow-transfer {
                81.187.81.32;
                81.187.203.131;
                81.187.203.134;
                81.187.203.128/25;
                192.168.1.0/24;
                213.138.103.94;
             };
        };
zone "pearlman.co.uk" IN {
             type master;
             file "db.pearlman.co.uk";
             allow-transfer {
                81.187.81.32;
                81.187.203.131;
                81.187.203.134;
                81.187.203.128/25;
                192.168.1.0/24;
                213.138.103.94;
             };
        };
zone "ukcns.com" IN {
             type master;
             file "db.ukcns.com";
             allow-transfer {
                81.187.81.32;
                81.187.203.131;
                81.187.203.134;
                81.187.203.128/25;
                192.168.1.0/24;
                213.138.103.94;
             };
        };
zone "1.168.192.in-addr.arpa" {
        type master;
        file "192.168.1.rev";
             allow-transfer {
                81.187.81.32;
                81.187.203.131;
                81.187.203.134;
                81.187.203.128/25;
                192.168.1.0/24;
             };
        };
zone "128-255.203.187.81.in-addr.arpa" {
        type master;
        file "128-255.203.187.81.rev";
             allow-transfer {
                81.187.81.32;
                81.187.203.131;
                81.187.203.134;
                81.187.203.128/25;
                192.168.1.0/24;
                213.138.103.94;
             };
        };
And the lookup failures:-

Code: Select all

[peter@pinball Gdrive]$ host 81.187.203.150 jupiter-e.grinton.net
Using domain server:
Name: jupiter-e.grinton.net
Address: 81.187.203.150#53
Aliases: 

Host 150.203.187.81.in-addr.arpa not found: 5(REFUSED)

[peter@pinball Gdrive]$ dig @jupiter-e.grinton.net -x 81.187.203.150

; <<>> DiG 9.10.3-P3 <<>> @jupiter-e.grinton.net -x 81.187.203.150
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 26388
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;150.203.187.81.in-addr.arpa.	IN	PTR

;; Query time: 36 msec
;; SERVER: 81.187.203.150#53(81.187.203.150)
;; WHEN: Tue Feb 23 14:56:31 GMT 2016
;; MSG SIZE  rcvd: 56

[peter@pinball Gdrive]$ dig @jupiter-e.grinton.net +norecurse -x 81.187.203.150

; <<>> DiG 9.10.3-P3 <<>> @jupiter-e.grinton.net +norecurse -x 81.187.203.150
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 27384
;; flags: qr; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;150.203.187.81.in-addr.arpa.	IN	PTR

;; Query time: 36 msec
;; SERVER: 81.187.203.150#53(81.187.203.150)
;; WHEN: Tue Feb 23 14:56:46 GMT 2016
;; MSG SIZE  rcvd: 56

Post Reply