I need to add a TXT record for the subdomain test.domain.com in the zone file. In this zone file there is an existing CNAME for the same subdomain. The two records looking like this:
test IN CNAME asdf.someotherdomain.com.
test IN TXT "Some text i need to add"
But when I try to save this I get an error:
dns_master_load: :45: test.domain.com: CNAME and other data
zone domain.com/IN: loading from master file failed: CNAME and other data
zone domain.com/IN: not loaded due to errors.
status: FAIL
It works if I do it with different subdomains, for example:
test IN CNAME asdf.someotherdomain.com.
testing IN TXT "Some text i need to add"
I'm not exactly the best there is when it comes to DNS. Is it not possible to have the same subdomain in this scenario? Or am I missing something?
The servers are running bind.
The problem you're having is an issue with the rules of DNS, which forbid a CNAME record where another record exists.
If a CNAME RR is present at a node, no other data should be present; this ensures that the data for a canonical name and its aliases cannot be different. This rule also insures that a cached CNAME can be used without checking with an authoritative server for other RR types.