• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 512
  • Last Modified:

Reverse DNS Bind

hi experts, I need help setting a reverse dns for a domain. I created the zone file

$ttl 38400
domain.tld.      IN      SOA      ns1.domain.tld. web.domain.tld. (
                  1217619153
                  10800
                  3600
                  604800
                  38400 )
domain.tld.      IN      NS      ns1.domain.tld.
domain.tld.      IN      A      192.168.1.1
domain.tld.      IN      NS      ns2.domain.tld.
ns1.domain.tld.      IN      A      192.168.1.1
ns2.domain.tld.      IN      A      192.168.1.2
www.domain.tld.      IN      CNAME      domain.tld.

I updated named.conf

zone "domain.tld" {
      type master;
      file "/var/named/chroot/var/named/domain.tld.hosts";
      };

and now the DNS is working fine, but I want to create a reverse zone PTR but I have no clue on how to do it, could you give me a step by step example to configure it??

thanks
0
ricuff
Asked:
ricuff
  • 12
  • 7
  • 3
1 Solution
 
ricuffAuthor Commented:
could you give me a step by step help configuring it thanks
0
 
Raheem05Commented:
OK do you host your own DNS? I am assuming you do by the IP address please clarify
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
ricuffAuthor Commented:
yes I host my dns and I have static ip address thanks
0
 
Raheem05Commented:
Is this a windows DNS on a windows box?
0
 
ricuffAuthor Commented:
linux on centos and bind
0
 
Kerem ERSOYPresidentCommented:
Hi Please modify your zone file such as below:

@ macro reresents the zonne neame you've defined in your named.conf to refer this zone. So you don't need to explicitly specify the name jsut to mention @ is enough. Then you don't need to specify the domain name explicitly if it will refer the prevous record. soI've deleted them. Another point is you don't need to enter FQDN if all server names are relative to your own domain. since it will be completed with the domain itself. I've removed them too and for convenience I've put NS records together and then the A record.

Please check these RFC's for DNS zones:

RFC1912
RFC2181
RFC2182
RFC2308
$ttl 7200     ; RFC 2308 staes 1-3 hours
@         IN      SOA      ns1.domain.tld. web.domain.tld. (
                  2010011301   ; According to RFC 1912 YYYYMMDDnn
                  10800        ; RFC 1912 1200 - 43200 Seconds OK
                  3600         ; RFC 1912 120-7200 seconds OK
                  604800       ; RFC 1912 2-4W  should be at least: 1209600 Please modify
                  38400 )      ; RFC 2038 1-3 hours Please modify

                 IN      NS      ns1
                 IN      NS      ns2
                 IN      A       192.168.1.1
ns1              IN      A      192.168.1.1
ns2              IN      A      192.168.1.2
www              IN      CNAME      ns1

Open in new window

0
 
Kerem ERSOYPresidentCommented:
Your path is an absolute path. You won't be seeing the whole tree after you've chrooted. Don't you use the chrooted version of named? This is too dangerous !!! if your're not using it just install the fileset:

yum install named-chroot.

to check what version of named you're using use the command:

rpm -qa | grep bind


Cheers,
K.
0
 
Kerem ERSOYPresidentCommented:
This is what your named.conf should look like:
acl localnet { x.x.x.x/y; }

options {
        version "12.2.5I";
        directory "/var/named";
        dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";

        allow-transfer { localnet;};

        allow-recursion { localnet; };
};

zone "." in {
        type hint;
        file "data/named.root";
};

// Assumeng your IP segment is 10.20.30.x and whole C class belongs to you

zone "30.20.10.in-addr.arpa" in {
        type master;
        file "data/named.loc";
};

zone "domain.tld" {
      type master;
      file "data/domain.tld.hosts";
};


zone "0.0.127.in-addr.arpa" in {
        type master;
        file "data/named.loc";
};

Open in new window

0
 
ricuffAuthor Commented:
ok now should I save this as zone file? if yes should I save it in rhe normal zone file? and where I see the PTR record?
0
 
Kerem ERSOYPresidentCommented:
OOps sorry this should read:
zone "30.20.10.in-addr.arpa" in {
        type master;
        file "data/named.rev-10.20.30";
};

Open in new window

0
 
Kerem ERSOYPresidentCommented:
The contents should be something similar to the below snippet. Notice that this time DNS servers are FQDN. SOA values are in accordance with related RFC's

and don't for get that:
-  The first parameter in SOA must be one of your name servers since it is your domain origin.
- The second parameter is the address only the first dot will be replaced with a "@" so your address in the below code will be interpreted as :

postmaster.domain.tld    postmaster@domain.tld

I don't know if you really have an email address like web@domain.tld (according to your SOA record)  in your SMTP server if not replace it to something valid. Please check the RFC 1912.

Cheers,
K.
$ttl 7200     
@         IN      SOA      ns1.domain.tld. postmaster.domain.tld. (
                  2010011301   ; Serial
                  10800        ; Refresh for secondaries
                  3600         ; Retry
                  1209600      ; Expire
                  7200 )       ; TTL

                 IN      NS      ns1.domain.tld.
                 IN      NS      ns2.domain.tld.

1                IN      PTR     ns1.domain.tld.
2                IN      PTR     ns2.domain.tld.

Open in new window

0
 
Kerem ERSOYPresidentCommented:
> ok now should I save this as zone file? if yes should I save it in rhe normal zone file? and where I see
> the PTR record?

The example in the note <a href=http://www.experts-exchange.com/OS/Linux/Q_25050670.html#a26302064>http://#26302064</a> is the contents of your /var/named/chroot/etc/named.conf not a zone file.

cheers,
K.
0
 
Kerem ERSOYPresidentCommented:
> and where I see the PTR record?

You see it in the node ID  http://www.experts-exchange.com/OS/Linux/Q_25050670.html#a26302064
0
 
Kerem ERSOYPresidentCommented:
0
 
Kerem ERSOYPresidentCommented:
The zone file belongs to the address range:

10.20.30   = 30.20.10.in-addr.arpa

The record "1 PTR  ..." hence means : 10.20.30.1

I've used the 10.x.x.x segment for convenience. In your IP range it would be: 192.168.1.1 and the zone record in your named.conf will be:

zone "1.168.192.in-addr.arpa" in {
        type master;
        file "data/named.rev-192.168.1";
};


so the @ macro for this zoe will mean: 1.168.192.in-addr.arpa This is why we're using absolute path for the DNS servers otherwise we just leave them as ns1 and ns2 they will be completed as :

ns1.1.192.168.in-addr.arpa which would be meaningless.

Cheers,
K.
0
 
ricuffAuthor Commented:
ok let me understand please

1) I modify the existing zone file and I add the @         IN      SOA      ns1.domain.tld. web.domain.tld.
instead of domain.tld.      IN      SOA      ns1.domain.tld. web.domain.tld. and save it

2) I add to named.conf
zone "30.20.10.in-addr.arpa" in {
        type master;
        file "data/named.rev-10.20.30";
};

3) I create a file with this content
$ttl 7200      
@         IN      SOA      ns1.domain.tld. postmaster.domain.tld. (
                  2010011301   ; Serial
                  10800        ; Refresh for secondaries
                  3600         ; Retry
                  1209600      ; Expire
                  7200 )       ; TTL
 
                 IN      NS      ns1.domain.tld.
                 IN      NS      ns2.domain.tld.
 
1                IN      PTR     ns1.domain.tld.
2                IN      PTR     ns2.domain.tld.


and where I should save it and what name?
0
 
Kerem ERSOYPresidentCommented:
> and where I should save it and what name?

You've already answered this:

2) I add to named.conf
zone "30.20.10.in-addr.arpa" in {
        type master;
        file "data/named.rev-10.20.30";
};

So it will be saved under the file called: named.rev-10.20.30  The path will be

/var/named/chroot/var/named/data and the file must be saved under this path rovided you have:

options {

        directory "/var/named";

}

command in your named.conf. As you see it is relative to the chroot directory which is: /var/named/chroot. If you don't have the options statement it will expect the file to be under:

/var/named/chroot/data. Which is a strange place so I'll trongly recommend you to include the options and ACL part to your named.conf too.

Cheers,
K.

0
 
ricuffAuthor Commented:
ok thanls I am going to try it please give me a few hours to finish and let you know thanks
0
 
Kerem ERSOYPresidentCommented:
ok just take your time and let me know If I could be of further help.

cheers,
k.
0
 
ricuffAuthor Commented:
thanks great it is working
0
 
Kerem ERSOYPresidentCommented:
You're welcome.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 12
  • 7
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now