I've a weird issue with bind.
Premise: I'm using bind (version 9.16_11) installed on pfSense, but despite this I can change almost anything on bind configuration.
I've configured a simple forward zone, the configuration is something like this:
zone "dom001.my-domain.com" {
type forward;
forward only;
forwarders { 192.168.29.10; };
};
Now, if I try to do a nslookup to an host in this domain I see an error. Example:
Non-authoritative answer:
Name: mail2.dom001.my-domain.com
Address: 192.168.210.126
** server can't find mail2.dom001.my-domain.com: SERVFAIL
The weird thing is that the answer is received (you can see the address in the response) but despite this I see the SERVFAIL error.
Other weird thing, dig doesn't reports any error:
; <<>> DiG 9.16.6 <<>> mail2.dom001.my-domain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53129
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 3218b8a1b8f64565eb9bd6636124bf73640809a4347f3bcf (good)
;; QUESTION SECTION:
;mail2.dom001.my-domain.com. IN A
;; ANSWER SECTION:
mail2.dom001.my-domain.com. 30 IN A 192.168.210.126
;; Query time: 30 msec
;; SERVER: 172.16.0.2#53(172.16.0.2)
;; WHEN: Tue Aug 24 11:44:19 CEST 2021
;; MSG SIZE rcvd: 110
During these queries I see some 'warnings' on bind's logs:
Aug 24 10:42:58 named 19540 lame-servers: info: FORMERR resolving 'mail2.dom001.my-domain.com/AAAA/IN': 192.168.29.10#53
Aug 24 10:42:58 named 19540 resolver: notice: DNS format error from 192.168.29.10#53 resolving mail2.dom001.my-domain.com/AAAA for client 10.16.16.41#38299: Name cluster.local (SOA) not subdomain of zone dom001.my-domain.com -- invalid response
I've checked further and it seems that the issue is related to SOA records on forwarder server:
;; QUESTION SECTION:
;mail2.dom001.my-domain.com. IN SOA
;; ANSWER SECTION:
cluster.local. 30 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1629766398 7200 1800 86400 30
In fact the answer is cluster.local
instead of dom001.my-domain.com
.
This issue is causing strange behavior depending on OS used. For example I see that most Linux server are working fine, while some version of Alpine Linux cannot resolve hostnames on that domain.
And even with the server that are working fine, I have bind's logs full of errors due to this issue.
Unlucky I cannot control the forwarder server and change the SOA record.
My question is: how I can configure bind in order to ignore the SOA record of that forwarder and accept the answer even if the SOA is not coerent?
I know that's not the best solution, but I need to workaround the misconfigured forwarder.
Thanks in advance for your help!