I believe I've found my issue.
I think it all boils down to the $ORIGIN option.
In standard "master file format" files if you don't add the trailing '.' then the name is assumed to be relative to the current zone file's $ORIGIN (which is either specified in the zone file, or taken from the zone statement in named.conf otherwise).
My pfsense Bind installation is appending a "." after my CNAMEs (in the file, not the web interface). The . makes the name be relative to the root, without it, it the name will be relative to the current zone. The standard zone format is defined in rfc1035 and rfc1034.
A workaround? Use FQDN for the CNAME.
In the very possible senerio I'm missing something, here is my named.conf:
_**#Bind pfsense configuration
#Do not edit this file!!!
key "rndc-key" {
algorithm hmac-md5;
secret "U2pHDolr0KZStIQrFOVPTw==";
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};
options {
directory "/etc/namedb";
pid-file "/var/run/named/pid";
statistics-file "/var/log/named.stats";
max-cache-size 512M;
listen-on-v6 { ::1; };
listen-on { 192.168.0.254; 127.0.0.1; };
notify yes;
allow-query { any; };^M
empty-zones-enable yes;
};
logging {
channel custom {
syslog daemon;
print-time no;
print-severity yes;
print-category yes;
severity dynamic;
};
category default { custom; };
};
acl "kc.corp" {
192.168.0.0/24;
};
view "LAN" {
recursion yes;
match-clients { any; };
allow-recursion { any; };
zone "kc.corp" {
type master;
file "/etc/namedb/master/LAN/kc.corp.DB";
allow-query { any; };
allow-transfer { kc.corp; };
allow-update { kc.corp; };
};
zone "0.168.192.in-addr.arpa" {
type master;
file "/etc/namedb/master/LAN/0.168.192.DB";
allow-query { kc.corp; };
allow-transfer { kc.corp; };
allow-update { kc.corp; };
};
zone "." {
type hint;
file "/etc/namedb/named.root";
};
};**_
My kc.corp zone file: In it, notice the trailing periods after the CNAME value. By placing kc.corp after the gw CNAME, it worked as expected.
_**$TTL 6h
;
; Database file kc.corp.DB for kc.corp zone.
; Do not edit this file!!!
; Zone version 2
;
kc.corp. IN SOA 6BH3S52.kc.corp. zonemaster.kc.corp. (
2 ; serial
1d ; refresh
2h ; retry
4w ; expire
1h ; default_ttl
)
;
; Zone Records
;
@ IN NS 6BH3S52.kc.corp.
@ IN NS X7DWE.kc.corp.
6BH3S52 IN A 192.168.0.254
gateway IN CNAME 6BH3S52.
gw IN CNAME 6BH3S52.kc.corp.
X7DWE IN A 192.168.0.1
SRXC606 IN A 192.168.0.69
me IN CNAME SRXC606.
N5550 IN A 192.168.0.2
ns1 IN CNAME 6BH3S52.
ns2 IN CNAME X7DWE.
NextCloud IN CNAME X7DWE.
switch IN A 192.168.0.253
p1 IN A 192.168.0.22
p2 IN A 192.168.0.23
HS1 IN A 192.168.1.1
HS2 IN A 192.168.1.69
AP1 IN A 192.168.0.50
AP2 IN A 192.168.0.51
pfsense IN CNAME 6BH3S52.
VM-Sandbox IN A 192.168.0.110
ns3 IN CNAME N5550.**_
I did try $ORIGIN kc.corp. in the zone custom options, but it threw and error on zone load of Unknown Option.