Score:0

How to resolve NXDOMAIN in centos using bind/named package

cn flag
9me

I am trying to configure DNS server on centos 7. I am following this link. when I run dig -x 192.168.40.107 I don't receive any answers record. here is output

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.el7_9.13 <<>> -x 192.168.40.107
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 24981
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;107.40.168.192.in-addr.arpa.   IN  PTR

;; AUTHORITY SECTION:
168.192.IN-ADDR.ARPA.   86400   IN  SOA 168.192.IN-ADDR.ARPA. . 0 28800 7200 604800 86400

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Mar 09 16:18:26 +04 2023
;; MSG SIZE  rcvd: 111

What am I doing wrong ? Thank you My config files are

/etc/named.conf

options {
    listen-on port 53 { 127.0.0.1; 192.168.40.107; };
#   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; 192.168.40.0/24; };
    recursion yes;
    forwarders {
    8.8.8.8;
    8.8.4.4;
  };
    dnssec-enable yes;
    dnssec-validation yes;
    bindkeys-file "/etc/named.root.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";
};

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

/etc/named/named.conf.local

zone "okd.local" {
    type master;
    file "/etc/named/zones/db.okd.local"; # zone file path
};

zone "40.168.192.in-addr.erpa" {
    type master;
    file "/etc/named/zones/db.40.168.192"; # 192.168.40.0/24 subnet
};

/etc/named/zones/db.okd.local

$TTL      604800
@     IN     SOA     okd4-services.okd.local. admin.okd.local. (
               1     ; Serial
          604800     ; Refresh
           86400     ; Retry
         2419200     ; Expiry
          604800     ; Nagitave cache TTL
)

; name servers - NS Records
    IN      NS      okd4-services

; name servers - A Records
okd4-services.okd.local.        IN     A     192.168.40.107

; OpenShift container plateform cluster - A Records
okd4-bootstrap.lab.okd.local.   IN      A     192.168.40.103
okd4-master1.lab.okd.local.     IN      A     192.168.40.104
okd4-worker1.lab.okd.local.     IN      A     192.168.40.105
okd4-worker2.lab.okd.local.     IN      A     192.168.40.106


; OpenShift internal cluster IPs - A Records

api.lab.okd.local.                              IN      A     192.168.40.107
api-int.lab.okd.local.                          IN      A     192.168.40.107
*.apps.lab.okd.local.                           IN      A     192.168.40.107
etcd-0.lab.okd.local.                           IN      A     192.168.40.104
console-openshift-console.apps.lab.okd.local.   IN      A     192.168.40.107
oauth-openshift.apps.lab.okd.local.             IN      A     192.168.40.107

; OpenShift internal cluster IPs - SRV Records

_etcd-server-ssl._tcp.lab.okd.local     86400   IN     SRV    0     10    2380    etcd-0.lab

/etc/named/zones/db.40.168.192

$TTL 604800
@     IN     SOA     okd4-services.okd.local. admin.okd.local. (
               6     ; Serial
          604800     ; Refresh
           86400     ; Retry
         2419200     ; Expiry
          604800     ; Nagitave cache TTL
)

; name servers - NS Records
    IN      NS      okd4-services.okd.local.

; name servers - PTR Records
107        IN     PTR     okd4-services.okd.local.

; OpenShift container Plateform Cluster - PTR Records

103    IN    PTR    okd4-bootstrap.lab.okd.local.
104    IN    PTR    okd4-master1.lab.okd.local.  
105    IN    PTR    okd4-worker1.lab.okd.local.  
106    IN    PTR    okd4-worker2.lab.okd.local.  
107    IN    PTR    api.lab.okd.local.           
107    IN    PTR    api-int.lab.okd.local.       
cn flag
I think your problem is `erpa`?
9me avatar
cn flag
9me
How can I fix this ? I am new in this and don’t know that much about it.
cn flag
Change the `erpa` typo to `arpa`?
9me avatar
cn flag
9me
Thank you. I also had an other error which was file path of zone file.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.