I have recently been working, but not finished settings up an email stack from scratch tutorial. Of importance was having dnssec enabled with unbound for opendkim. For work, I am trying to use kamailio to bypass nat on sip phones behind double nat, and one requirement was a DNS entry that is not supported by namecheap. It has been 30 years since I ran my own nameserver but decided to go this route with bind 9.20. Kamailio is running on a separate server but decided to put bind on the FreeBSD mail project server. I don't always understand what I am doing, more of a trial and error kind of guy, and once in awhile get that "Oh" light bulb kind of thing.
So I'll probably setup a tutorial on bind9 setup, since I did get it working. But getting no 'ad' flag with dig. It might just be that with my own authoritative server I am not considered authoritative? I have had some issues with ipfw, and putting static routes before outgoing setup and established seems to break things, might have something to do with edns. Currently everything works except when using dig against the FreeBSD dns server there is no 'ad' flag.
Figuring out how to upload the DS key records to namecheap with missing web enable buttons was fun but I'll cover that in the howto.
# So NICE it has the 'ad' flag set.
# So why no ad flag is set?
Also I just noticed, recursion enabled but not accepted, but I am not trying recursive, it's set as the authoritative server for itself?
Ok a little more DIGGING and found +norecurse
I guess I should post my named.conf
Thanks in advance.... John
So I'll probably setup a tutorial on bind9 setup, since I did get it working. But getting no 'ad' flag with dig. It might just be that with my own authoritative server I am not considered authoritative? I have had some issues with ipfw, and putting static routes before outgoing setup and established seems to break things, might have something to do with edns. Currently everything works except when using dig against the FreeBSD dns server there is no 'ad' flag.
Figuring out how to upload the DS key records to namecheap with missing web enable buttons was fun but I'll cover that in the howto.
Code:
dig @1.1.1.1 okbsd.com +dnssec
; <<>> DiG 9.18.33-1~deb12u2-Debian <<>> @1.1.1.1 okbsd.com +dnssec
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23199
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags: do; udp: 1232
;; QUESTION SECTION:
;okbsd.com. IN A
;; ANSWER SECTION:
okbsd.com. 600 IN A 147.135.65.97
okbsd.com. 600 IN RRSIG A 13 2 600 20250613212124 20250530225014 8586 okbsd.com. FHw/GD0vlx/aczwTJhlrsdEHyH1Ur3TDiE7wF0rOnDSX/hFgHO5oBm4o 79xIU/a+O9cN7Ms/VBXzeOQpJc25ow==
# So NICE it has the 'ad' flag set.
Code:
dig @okbsd.com okbsd.com +dnssec +multiline
; <<>> DiG 9.18.33-1~deb12u2-Debian <<>> @okbsd.com okbsd.com +dnssec +multiline
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24928
;; flags: qr aa rd; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags: do; udp: 1232
; COOKIE: 41cf5a6648e6d47101000000683b992a1839d302be455dcb (good)
;; QUESTION SECTION:
;okbsd.com. IN A
;; ANSWER SECTION:
okbsd.com. 600 IN A 147.135.65.97
okbsd.com. 600 IN RRSIG A 13 2 600 (
20250613212124 20250530225014 8586 okbsd.com.
FHw/GD0vlx/aczwTJhlrsdEHyH1Ur3TDiE7wF0rOnDSX
/hFgHO5oBm4o79xIU/a+O9cN7Ms/VBXzeOQpJc25ow== )
Also I just noticed, recursion enabled but not accepted, but I am not trying recursive, it's set as the authoritative server for itself?
Ok a little more DIGGING and found +norecurse
Code:
dig @okbsd.com okbsd.com +dnssec +multiline +norecurse
; <<>> DiG 9.18.33-1~deb12u2-Debian <<>> @okbsd.com okbsd.com +dnssec +multiline +norecurse
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12809
;; flags: qr aa; QUERY: 1, ANSWER: 2, AUTHORITY: 3, ADDITIONAL: 9
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags: do; udp: 1232
; COOKIE: f889823d2fda422a01000000683b9b3a8a405bea7ba10ee9 (good)
;; QUESTION SECTION:
;okbsd.com. IN A
;; ANSWER SECTION:
okbsd.com. 600 IN A 147.135.65.97
okbsd.com. 600 IN RRSIG A 13 2 600 (
20250613212124 20250530225014 8586 okbsd.com.
FHw/GD0vlx/aczwTJhlrsdEHyH1Ur3TDiE7wF0rOnDSX
/hFgHO5oBm4o79xIU/a+O9cN7Ms/VBXzeOQpJc25ow== )
;; AUTHORITY SECTION:
okbsd.com. 600 IN NS ns1.okbsd.com.
okbsd.com. 600 IN NS ns2.okbsd.com.
okbsd.com. 600 IN RRSIG NS 13 2 600 (
20250613212124 20250530225014 8586 okbsd.com.
SWulrUU+kw5PxcKs0diKb8NfWpGPxKsiTjwCVI3IWPW7
2scABJS9mRf5IdZrgiYmoLI9o0+tsbvAU+8o8gkUOw== )
;; ADDITIONAL SECTION:
ns1.okbsd.com. 600 IN AAAA 2604:2dc0:100:1261::10
ns2.okbsd.com. 600 IN AAAA 2604:2dc0:100:1261::10
ns1.okbsd.com. 600 IN A 147.135.65.97
ns2.okbsd.com. 600 IN A 147.135.65.97
ns1.okbsd.com. 600 IN RRSIG A 13 3 600 (
20250613194706 20250530225014 8586 okbsd.com.
RcRvmhXeHfTJMRVeUw3Hw82Hr04B+leDrGeslW9Uo/tC
HZiH82IVL0Kd1oUKJ3TSf1VV08H82VkFTgBZY2+Pzg== )
ns1.okbsd.com. 600 IN RRSIG AAAA 13 3 600 (
20250613194706 20250530225014 8586 okbsd.com.
BO8Hf6L/8ZAFf5c48sOx21JJtAY5J8V0GMJuSaFlehD5
9V13+H2mKLZqo57fjIA9SlEE5zI0Cx99e8bot8DbXQ== )
ns2.okbsd.com. 600 IN RRSIG A 13 3 600 (
20250613194706 20250530225014 8586 okbsd.com.
FRXEvS/gypYiH7QmoBOknxsX0D4oK0f6kkr9KkqI8VmT
tufP8QAOWSz1EyqyMqWNoFIY7PVRULcB0mAUQfMeSw== )
ns2.okbsd.com. 600 IN RRSIG AAAA 13 3 600 (
20250613194706 20250530225014 8586 okbsd.com.
t0GQDLtCeqlIAkNht8V5jTvXMtDOT9szveb191/8RbLi
I5OMeTbOQA+8MXxd81V7V1+hqwwzAKV8FcPx3LI7IQ== )
Code:
options {
directory "/usr/local/etc/namedb/working";
pid-file "/var/run/named/pid";
dump-file "/var/dump/named_dump.db";
statistics-file "/var/stats/named.stats";
// DNSSEC
dnssec-validation auto;
// RECURSION
recursion yes;
allow-recursion { 127.0.0.1;
::1;
147.135.65.97;
2604:2dc0:100:1261::10;
111.222.111.222
};
listen-on {
127.0.0.1;
147.135.65.97;
};
listen-on-v6 {
::1;
2604:2dc0:100:1261::10;
};
disable-empty-zone "255.255.255.255.IN-ADDR.ARPA";
disable-empty-zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";
disable-empty-zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";
allow-query { any; };
}
zone "." { type hint; file "/usr/local/etc/namedb/named.root"; };
...defaults ...
zone "okbsd.com" {
type master;
file "/usr/local/etc/namedb/dynamic/db.okbsd.com";
dnssec-policy default;
inline-signing yes;
};