i install dns in centos machine but it not resolve ip to name and name to ip

I have some problem regarding DNS. I install DNS in CentOS 7 machine and my CentOS machine ip is 192.168.0.155 . If I run nslookup FQDN (centos7.unixmen.local) name then it resolves the IP, which means my forward zone is running, and my output is

nslookup centos7.unixmen.local

Server:     192.168.0.155
Address:    192.168.0.155#53

Name:   centos7.unixmen.local

Address: 192.168.0.155

but if i run

nslookup 192.168.0.155

Server:     192.168.0.155
Address:    192.168.0.155#53

** server can't find 155.0.168.192.in-addr.arpa.: NXDOMAIN

that means reverse zone not resolve to IP to name.

My /etc/named.conf file

options {

        listen-on port 53 {
                127.0.0.1;
                192.168.0.155;
                };
        listen-on-v6 port 53 { ::1; };
        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-query     { any; };

*/
        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;

        /* 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";
        forwarders {
                8.8.8.8;
                8.8.8.4;
                };
        forward first;
};


logging {

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

};

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


zone "unixmen.local" IN {

      type master;
      file "forward.unixmen";
      allow-update { none;};
};

zone "0.168.192.in-add.arpa" IN {

      type master;
      file "reverse.unixmen";
      allow-update { none; };
};

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

include "/etc/named.root.key

My Reverse zone configuration file: /var/named/reverse.unixmen

$TTL 86400

@       IN SOA  centos7.unixmen.local. root.unixmen.local.(

                                        2011071001      ; serial
                                        3600            ; refresh
                                        1800            ; retry
                                        604800          ; expire
                                        86400           ; minimum TTL
)

@                IN     NS      centos7.unixmen.local.

@                IN    PTR      unixmen.local.

@                IN      A      192.168.0.155

@                IN     PTR     192.168.0.155

155              IN     PTR     centos7.unixmen.local.

My forward zone file at /var/named/forward.unixmen

$TTL 86400

@       IN SOA  centos7.unixmen.local. root.unixmen.local. (

                                        2011071001      ; serial
                                              3600      ; refresh
                                              1800      ; retry
                                             604800     ; expire
                                             86400      ; minimum TTL
)

@                  IN        NS   centos7.unixmen.local.

@                  IN        A       192.168.0.155

centos7            IN        A       192.168.0.155

In my CentOS 7 machine only one ethernet port and he direct connected to router using ethernet cable and all client window system connected to switch
and my

  • ip is 192.168.0.155
  • gateway 192.168.0.1
  • dns-192.168.0.1

Recently if I set my own IP 192.168.0.155 as a DNS IP in CentOS 7 machine then internet browsing working and also forward zone means name to IP is resolving but IP to name is not resolving.

Please help me resolve my problem.

Answer

It seems that in your /etc/named.conf file you have a spelling error, it should be

zone "0.168.192.in-addr.arpa" IN {

      type master;
      file "reverse.unixmen";
      allow-update { none; };
};

Note the r in addr.

Also you have pasted in a stray closing comment */ from your /etc/named.conf file near the line saying recursion yes;

Attribution
Source : Link , Question Author : reethismanish , Answer Author : BeowulfNode42

Leave a Comment