Is it allowed to have an NS record be a CNAME? E.g.:
subdomain.example.com. IN NS ns1.example.com.
ns1.example.com. CNAME foo.example.com.
foo.example.com. IN A 10.1.1.1
This doesn't seem to work in bind though this (of course) does:
subdomain.example.com. IN NS foo.example.com.
foo.example.com. IN A 10.1.1.1
Any pointers to RFCs prohibiting this setup would be appreciated.
RFC 1035 defines the NS resource record (RR) merely as a domain-name without specifying the RR type of the target (though it does make it clear that it can't be an IP).
RFC 1912 has more specifics, in section 2.4:
As was later pointed out in the comments, RFC 2181 Section 10.3 has a clear prohibition against this: