1

I have a DNS server with the following zones in /etc/bind/named.conf.local

zone "david.com" {
    type master;
    file "forward";
};

zone "1.168.192.in-addr.arpa" {
    type master;
    file "reverse";
};

The file forward is as follows:

$TTL    604800
@   IN  SOA dlcsrv.david.com. root.david.com. (
                2   ;   Serial
                604800  ;   Refresh
                86400   ;   Retry
                2419200 ;   Expire
                604800) ;   Negative Cache TTL
;
@   IN  NS  david.com.
@   IN  A   192.168.1.37
www IN  A   192.168.1.37
ftp IN  A   192.168.1.37

And reverse file:

$TTL    604800
@   IN  SOA dlcsrv.david.com. root.david.com. (
                2   ;   Serial
                604800  ;   Refresh
                86400   ;   Retry
                2419200 ;   Expire
                604800) ;   Negative Cache TTL
;
@   IN  NS  david.com.
37  IN  PTR david.com.

Currently, this works so that if I type nslookup david.com I get the address 192.168.1.37, and if I type nslookup 192.168.1.37 I get name = david.com.

How can I add another zone, called david.net, which should also be mapped to the IP 192.168.1.37.

It has been a challenging task. I will thank you for any guidance.

1 Answer 1

1

Reverse mappings have nothing to do with forward mappings; even though some apps require them to match, both are configured independently of each other.

To set up a forward mapping david.net --> 192.168.1.37, copy the entire david.com zone:

zone "david.com" {
    type master;
    file "forward-david.com.db";
};

zone "david.net" {
    type master;
    file "forward-david.net.db";
};

(Actually, since your zonefile doesn't have a $ORIGIN, you could probably re-use the same file for both zones...)

To set up a reverse mapping 192.168.1.37 --> david.net, add a second PTR record for the same 37 label. Note that multiple reverse mappings for the same IP is very uncommon; while nslookup should show both results, other tools will just pick one randomly.

37  IN  PTR david.com.
37  IN  PTR david.net.

(In practice most domains and addresses have entirely different forward and reverse information; e.g. there might be dozens of domains pointing to a single IP address, but that address would merely have a boring webserver47.hostingcompany.tld as its reverse.)

0

You must log in to answer this question.

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