0

I have virtual setup on NAT in VMWare with a Cent OS as a DNS Server (192.168.102.159), I ran the zone and conf test through bind named, allresults are OK, when I run nslookup from a client I get :

nslookup
> server 192.168.102.159
Default server: 192.168.102.159
Address: 192.168.102.159#53

For the reverse lookup I get :

nslookup ns1.abc.local
Server:     192.168.102.2
Address:    192.168.102.2#53
** server can't find ns1.abc.local: NXDOMAIN

CONFIG FILES ifcfg-ens33

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=c39a3132-fecb-4688-aa6a-b83e4d8f09a3
DEVICE=ens33
HOSTNAME=ns2
IPADDR=192.168.102.159
SUBNETMASK=255.255.255.0
ADAPTER=ens33
GATEWAY=192.168.102.2
DNS1="192.168.102.2
NM_CONTROLLED=no
ONBOOT=yes

named.conf

acl internals { 192.168.102.0/24;  };
options {
        listen-on port 53 { 127.0.0.1; 192.168.102.159; };
        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";
        recursing-file  "/var/named/data/named.recursing";
        secroots-file   "/var/named/data/named.secroots";
        allow-query     { localhost; internals; };

        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;

        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";

        pid-file "/run/named/named.pid";
        session-keyfile "/run/named/session.key";
};

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

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

zone "abc.local" { type master; file "abc.db"; };

zone "102.168.192.IN-ADDR.ARPA" { type master; file "cba.db"; };

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

abc.db

$TTL 3H
$ORIGIN abc.local.

@       IN SOA ns1.abc.local. admin.abc.local. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        IN NS ns1.abc.local.

ns1     IN A 192.168.102.159

cba.db

$TTL 3H
$ORIGIN 102.168.192.IN-ADDR.ARPA.

@       IN SOA ns1.abc.local. admin.abc.local. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        IN NS ns1.abc.local.

100     IN PTR ns1.abc.local.

Zone and Conf check reports

[root@localhost ~]# named-checkzone 102.168.192.in-addr.arpa /var/named/cba.db
zone 102.168.192.in-addr.arpa/IN: loaded serial 0
OK
[root@localhost ~]# named-checkzone abc.local /var/named/abc.db
zone abc.local/IN: loaded serial 0
OK
[root@localhost ~]# named-checkconf
[root@localhost ~]# 

Firewall is configured as :

iptables -A INPUT -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 53 -j ACCEPT
  • It seems you are querying 192.168.102.2 instead of 192.168.102.159. Does nslookup ns1.abc.local 192.168.102.159 work? If yes, reconfigure DNS1="192.168.102.159 and you might want to configure a forwarders section including 192.168.102.2. – Thomas Dec 30 '18 at 11:45
  • Changed that DNS IP to 192.168.102.159, the client nslookup still results in the same answer, is this the IP I have to add to the client as well ? Currently the client usesthe DHCP and DNS of VMWare.. – Huud Rych Dec 30 '18 at 11:49
  • Well, you have to configure your clients to use the DNS server at a specific IP address. If they get the DNS from DHCP, then you have to configure the DHCP server which IP address to hand out for DHCP clients. – Thomas Dec 30 '18 at 12:03
0

Thank you Mr Thomas, the issue is resolved, apparently, I was so into it that I even forgot I was using a machine that is not configured properly to check the DNS, even though the client was in the NAT network it was not issued a DHCP by the Cent OS Server and thus it did not have any DNS configuration either, I was testing the client by manually adding entries. Finally I tested it through putty as before and both forward and reverse lookups are resolving successfully. Thank you all for your guidance and time, appreciate it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.