1

A little while ago i set up reverse lookup for our DNS server. The DNS server is very simple. I'm using BIND9 running on Debian jessie. The IP addresses are all static. The zone file looks like this (I replaced some stuff from the original file with example to disguise some information):

$TTL    604800
@       IN      SOA     ns.example. someone.example.de. (
                     4358998787         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns.example.
ns      IN      A       192.168.2.2
someone IN      A       192.168.2.3
; And some more records...

The reverse lookup file looks like this (again some diguised informations...):

$TTL    604800
@       IN      SOA     ns.example. someone.example.de (
        4561621654      ; Serial
            604800      ; Refresh
             86400      ; Retry
           2419200      ; Expire
            604800 )    ; Negative Cache TTL

@       IN      NS      ns.example.

1       IN      PTR     someting
2       IN      PTR     ns
; More records here

My named.conf.local looks like this:

zone "example" {
     type master;
     file "db.bartscher";
     notify no;
};

zone "2.168.192.in-addr.arpa" IN {
     type master;
     file "2.168.192.in-addr.arpa";
     allow-update { none; };
};

If i now lookup some name like this:

$ host someone
someone.example has address 192.168.2.3

And then reverse lookup that address like this:

$ host 192.168.2.3
3.2.168.192.in-addr.arpa domain name pointer someone.example.2.168.192.in-addr.arpa.

The domain name has a lot of stuff appended

Is this supposed to be like that? When i lookup some other domain name (which isn't in our domain) i get an ip address which can be looked up to another name which maps back to the same ip address, which doesn't hold for our reverse lookup. How can i configure BIND so looking up someone.example returns 192.168.2.3 and looking up 192.168.2.3 returns just someone.example? Is this even desired or is it "right" that the reverse lookup returns another domain?

To set up the reverse lookup i followed this guide

1 Answer 1

2

With the way you've put records in your zone file, this is expected. In reverse-mapping zones, it's important that the names on the right-hand side of PTR records be fully-qualified domain names, so make them:

1       IN      PTR     someting.example.
2       IN      PTR     ns.example.

And those pesky trailing-dots are important. Don't forget them or you'll end up with 2.168.192.in-addr.arpa appended again.

4
  • In fact the names were fully qualified, since the domain doesn't have a .de at end. Just the ending dots were missing. Thanks for the quick answer!
    – Kritzefitz
    Commented Feb 11, 2014 at 18:54
  • 1
    Names without trailing dots here are not fully qualified, however many labels they contain. You do not correctly understand what a fully-qualified domain name is, Ich Und Nicht Du. As milli says, the trailing dots are important, as they are what makes the domain names fully-qualified.
    – JdeBP
    Commented Feb 11, 2014 at 19:11
  • Okay, to correctly say what I wanted to say: To make the domain names qualified I only needed to add the trailing dot, not the .de, since our domain doesn't end with .de.
    – Kritzefitz
    Commented Feb 11, 2014 at 20:26
  • You had someone.example.de as the email address, that's why I assumed you meant example.de, But yes, I should have taken the zone name from the named.conf.local...
    – milli
    Commented Feb 12, 2014 at 1:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .