hostless DNS CNAME record

拟墨画扇 提交于 2020-01-06 20:22:28

问题


We are running BIND 9.9.7 on Centos 6.5 and for a long time I have been creating "hostless" DNS entries so that sites work with or without the www.

Eg:

www IN A 192.168.1.1
domain.com.   IN    A 192.168.1.1

However, our client wants to use a CNAME record to a cloudfront host and the "hostless" entry doesn't work as a CNAME record.

In fact, it more than doesn't work, BIND won't even load the zone file. The error is "failed: CNAME and other data"

domain.com.  IN CNAME host.cloudfront.net.

www IN CNAME host.cloudfront.net.

It will load and resolve fine without the domain.com entry. I have tried a few variations, but nothing seems to work. including "", "."

Can anyone tell me the correct syntax for this entry?


回答1:


There is no correct syntax for this (and it is not BIND specific, it is a side effect of RFC1912 which states that A CNAME record is not allowed to coexist with any other data.

Detailed explanation: Why can't a CNAME record be used at the apex (aka root) of a domain?

Some DNS providers might offer workaround hacks.



来源:https://stackoverflow.com/questions/37141949/hostless-dns-cname-record

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!