1

I'm running some small ISP here and I own couple of IP ranges.

I have given a few public IP addresses to some of my customer and they are running mail servers on them. They have demanded me to add reverse DNS entries (PTR) for their IPs.

I have Bind running on my server. Can I add multiple PTR records in same server/same file?

IP range I own: 192.168.10.0/24

Customer A: 192.168.10.103  
Customer B: 192.168.10.199  
Customer C: 192.168.10.169  
Customer D: 192.168.10.69  

Thanks.

chicks
  • 3,639
  • 10
  • 26
  • 36
root
  • 39
  • 2
  • 8
  • I thought this question was poorly researched until I googled and saw that most of the answers out there are for only adding a single record **plus** very few mention needing the `SOA` at the top like you need with all BIND zone files. – chicks Aug 18 '15 at 12:36
  • 1
    Thanks a lot for reply. Your solutions works fine, i have added in my reverse file. Locally it update waiting for getting populated across the public dns. – root Aug 18 '15 at 18:41
  • Its populated across the DNS (pubic) now but there there some online tool who check PTR record for my domain and there it shows nothing or error – root Aug 19 '15 at 05:09
  • Some sites could have a negative cache of the previous lack of answer. Without specific IPs or `dig` output it is hard to guess what is still wrong. – chicks Aug 19 '15 at 12:31
  • i know its not good but i can get your email please ? – root Aug 19 '15 at 12:46
  • if you're willing to pay my $150/hour consulting fee I'm happy to give you my email address, otherwise we should keep it public – chicks Aug 19 '15 at 12:53
  • To much expensive for now :). I don't mind to go public. – root Aug 19 '15 at 13:03
  • so please post the real IPs and output from `dig -x $YOURIP` – chicks Aug 19 '15 at 13:12
  • here is output of dig command dig -x 103.249.240.224 ; <<>> DiG 9.10.2-P3 <<>> -x 103.249.240.224 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57643 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 512 ;; QUESTION SECTION: ;224.240.249.103.in-addr.arpa. IN PTR ;; ANSWER SECTION: 224.240.249.103.in-addr.arpa. 1799 IN PTR mk.localhost-server.com. ;; Query time: 138 msec ;; SERVER: 192.168.1.1#53(192.168.1.1) ;; WHEN: Wed Aug 19 22:15:12 IST 2015 – root Aug 19 '15 at 16:45
  • That looks like it is working to me. I'll add the sample to my answer. – chicks Aug 19 '15 at 16:54
  • 1
    @chicks thanks for your solution...it working. Just curious about about why online tools are not showing it. check here http://mxtoolbox.com/ReverseLookup.aspx They are using some different mechanism to verify PTR record or as you said earlier it might be negative caching ? – root Aug 20 '15 at 04:52
  • Interesting, this fails for me now too. It looks like the chain of delegations is broken. Contact Gazon. I'll post dig/whois output in my answer. – chicks Aug 20 '15 at 12:08

2 Answers2

0

As you can see from this TLDP example you can have multiple PTR records in the same zone.

$TTL 3D
@               IN      SOA     yourdomain.com. root.yourdomain.com. (
                                199609206       ; Serial
                                28800   ; Refresh
                                7200    ; Retry
                                604800  ; Expire
                                86400)  ; Minimum TTL
                        NS      ns1.yourdomain.com.
                        NS      ns2.yourdomain.net.
;
;       Servers
;
1       PTR     router.yourdomain.com.
2       PTR     server.yourdomain.com.
;
;       Customers
;
69      PTR     mail.customerD.com.
103     PTR     mail.customerA.com.
169     PTR     mail.customerC.com.
199     PTR     mail.customerB.com.

It is a good idea to put any IPs you allocate into your reverses file to avoid duplicates.

working example

This looks good to me:

$ dig -x 103.249.240.224

; <<>> DiG 9.9.5-3ubuntu0.4-Ubuntu <<>> -x 103.249.240.224
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8551
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

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

;; ANSWER SECTION:
224.240.249.103.in-addr.arpa. 1685 IN   PTR mk.localhost-server.com.

;; ADDITIONAL SECTION:
mk.localhost-server.com. 21526  IN  A   103.249.240.224

;; Query time: 2 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Wed Aug 19 09:53:51 PDT 2015
;; MSG SIZE  rcvd: 99

$ dig mk.localhost-server.com

; <<>> DiG 9.9.5-3ubuntu0.4-Ubuntu <<>> mk.localhost-server.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61167
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;mk.localhost-server.com.   IN  A

;; ANSWER SECTION:
mk.localhost-server.com. 21520  IN  A   103.249.240.224

;; Query time: 1 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Wed Aug 19 09:53:56 PDT 2015
;; MSG SIZE  rcvd: 57

chicks@silver 09:53:56 ~ !515 $ 

and now it is broken

confirm broken:

$ dig -x 103.249.240.224

; <<>> DiG 9.9.5-3ubuntu0.3-Ubuntu <<>> -x 103.249.240.224
;; global options: +cmd
;; connection timed out; no servers could be reached

from http://mxtoolbox.com/SuperTool.aspx?action=ptr%3a103.249.240.224&run=toolpage :

PWS3v2 11784ms
  0  c.in-addr-servers.arpa  196.216.169.10  NON-AUTH  296 ms  Received 6 Referrals , rcode=NO_ERROR    103.in-addr.arpa.   86400   IN  NS  ns1.apnic.net,103.in-addr.arpa. 86400 IN    NS  ns2.lacnic.net,103.in-addr.arpa.    86400   IN  NS  ns3.apnic.net,103.in-addr.arpa. 86400   IN  NS  ns4.apnic.net,103.in-addr.arpa. 86400   IN  NS  sec1.authdns.ripe.net,103.in-addr.arpa. 86400   IN  NS  tinnie.arin.net,  

  1  ns4.apnic.net  202.12.31.140  NON-AUTH  187 ms  Received 4 Referrals , rcode=NO_ERROR    240.249.103.in-addr.arpa. 86400   IN  NS ns2.gazonindia.com,240.249.103.in-addr.arpa. 86400   IN  NS ns4.gazonindia.com,240.249.103.in-addr.arpa. 86400   IN  NS ns3.gazonindia.com,240.249.103.in-addr.arpa. 86400   IN  NS  ns1.gazonindia.com,  

  2  ns4.gazonindia.com  103.249.240.10  NON-AUTH  187 ms  Timeout after 3 sec, rcode=NO_ERROR      

  2  ns1.gazonindia.com  103.249.240.8  NON-AUTH  187 ms  Timeout after 3 sec, rcode=NO_ERROR      

  2  ns3.gazonindia.com  103.249.240.9  NON-AUTH  187 ms  Timeout after 3 sec, rcode=NO_ERROR      

  2  ns2.gazonindia.com    NON-AUTH  187 ms  Timeout resolving IP, rcode=NO_ERROR

This looks like Gazon's servers are not responding. So let's find out who to contact via whois:

$ whois 103.249.240.224
% [whois.apnic.net]
% Whois data copyright terms    http://www.apnic.net/db/dbcopyright.html

% Information related to '103.249.240.0 - 103.249.243.255'

inetnum:        103.249.240.0 - 103.249.243.255
netname:        GAZON
descr:          Gazon Communications India Limited
admin-c:        KD220-AP
tech-c:         SA683-AP
country:        IN
mnt-by:         MAINT-IN-IRINN
mnt-irt:        IRT-IRINN-IN
status:         ASSIGNED portable
changed:        hm-changed@apnic.net 20130613
mnt-routes:     MAINT-IN-GAZON
source:         APNIC

irt:            IRT-IRINN-IN
address:        Flat no. 6B, Uppals M6 Plaza, 6 Jasola District Centre, New Delhi-110025
e-mail:         helpdesk@irinn.in
abuse-mailbox:  abuse@irinn.in
admin-c:        IH175-AP
tech-c:         IH174-AP
auth:           # Filtered
mnt-by:         MAINT-IN-IRINN
changed:        hostmaster@irinn.in 20120907
source:         APNIC

role:           System Admin
address:        Parason House, 28, Venkatesh Nagar, Aurangabad, Maharashtra
country:        IN
phone:          +91-9762055555
fax-no:         +91-2402332944
e-mail:         kishor@parasonglobal.com
admin-c:        KD220-AP
tech-c:         KD220-AP
nic-hdl:        SA683-AP
remarks:        send spam and abuse report to abuse@parasonglobal.com
notify:         kishor@parasonglobal.com
abuse-mailbox:  abuse@parasonglobal.com
mnt-by:         MAINT-IN-PARASON
changed:        abuse@parasonglobal.com 20140801
source:         APNIC

person:         Kishor Desarda
address:        Parason House, 28, Venkatesh Nagar, Aurangabad, Maharashtra
country:        IN
phone:          +91-9762055555
fax-no:         +91-2402332944
e-mail:         kishor@parasonglobal.com
nic-hdl:        KD220-AP
remarks:        send spam and abuse report to abuse@parasonglobal.com
notify:         kishor@parasonglobal.com
abuse-mailbox:  abuse@parasonglobal.com
mnt-by:         MAINT-IN-PARASON
changed:        kishor@parasonglobal.com 20140801
source:         APNIC

% Information related to '103.249.240.0/24AS132770'

route:          103.249.240.0/24
descr:          Gazon Communications India Limited
origin:         AS132770
country:        IN
mnt-lower:      MAINT-IN-IRINN
mnt-routes:     MAINT-IN-IRINN
mnt-by:         MAINT-IN-IRINN
changed:        netadmin@gazonindia.com 20130708
source:         APNIC

% Information related to '103.249.240.0 - 103.249.243.255'

inetnum:        103.249.240.0 - 103.249.243.255
netname:        GAZON
descr:          Gazon Communications India Limited
admin-c:        KD1-IN
tech-c:         MN8-IN
country:        IN
mnt-by:         MAINT-IN-GAZON
mnt-irt:        IRT-GAZON-IN
status:         ASSIGNED portable
changed:        kishor@gazonindia.com
source:         APNIC

irt:            IRT-GAZON-IN
address:        Pune
phone:          +91 02065101230
fax-no:         +91 2402332944
e-mail:         netadmin@gazonindia.com
abuse-mailbox:  abuse@gazonindia.com
admin-c:        KD1-IN
tech-c:         MN8-IN
auth:           CRYPT-PW yx9RQZOlthZT6
remarks:        send spam and abuse report to abuse@gazonindia.com
mnt-by:         MAINT-IN-GAZON
changed:        netadmin@gazonindia.com 20130613
source:         IRINN

role:           Manager NOC
address:        Pune
country:        IN
phone:          +91 02065101230
fax-no:         +91 2402332944
e-mail:         netadmin@gazonindia.com
admin-c:        KD1-IN
tech-c:         KD1-IN
nic-hdl:        MN8-IN
remarks:        send spam and abuse report to abuse@gazonindia.com
notify:         abuse@gazonindia.com
abuse-mailbox:  abuse@gazonindia.com
mnt-by:         MAINT-IN-GAZON
changed:        netadmin@gazonindia.com 20130613
source:         IRINN

person:         Kishor Desarda
address:        Parason House, 28, Venkatesh Nagar, Jalna Road
country:        IN
phone:          +91 02065101230
fax-no:         +91 2402332944
e-mail:         kishor@gazonindia.com
nic-hdl:        KD1-IN
remarks:        send spam and abuse report to abuse@gazonindia.com
notify:         abuse@gazonindia.com
abuse-mailbox:  abuse@gazonindia.com
mnt-by:         MAINT-IN-GAZON
changed:        kishor@gazonindia.com 20130613
source:         IRINN

% Information related to '103.249.240.0/24AS132770'

route:          103.249.240.0/24
descr:          Gazon Communications India Limited
country:        IN
origin:         AS132770
remarks:        abuse@gazonindia.com
notify:         netadmin@gazonindia.com
mnt-lower:      MAINT-IN-GAZON
mnt-routes:     MAINT-IN-GAZON
mnt-by:         MAINT-IN-GAZON
changed:        netadmin@gazonindia.com 20130625
source:         IRINN

% This query was served by the APNIC Whois Service version 1.69.1-APNICv1r0 (UNDEFINED)
chicks
  • 3,639
  • 10
  • 26
  • 36
0

Yes, you not only can have multiple PTR records in the same reverse zone file, if your IP network is 192.168.10.0/24 and you thus have a reverse zone is 10.168.192.in-addr.arpa you don't really have a reasonable alternative solution.

It's important to note that the only thing that a reverse zone has a direct relation to is the IP network. The pointer records in the zone can refer to names in any number of zones (whatever names are the canonical names for these IP addresses).

There is a common misconception a reverse zone is paired with a "forward" zone.
This is simply not true and I can only guess that this idea comes from how documentation and guides often show one example of each without going into detail about the purpose or what kind of relation there is or, as is rather the case, there isn't between the two examples.

Håkan Lindqvist
  • 33,741
  • 5
  • 65
  • 90
  • He wasn't trying to have multiple IPs per `PTR`. The OP asked for multiple reverses within a single zone/IP block. We also have the real IP to work with from the comments. – chicks Aug 20 '15 at 11:57
  • @chicks I didn't claim they were trying to have multiple IPs per PTR (whatever that would imply) – Håkan Lindqvist Aug 20 '15 at 16:20