創建A記錄時,您可以使用記錄名稱的@
符號來指示父記錄,即無記錄名稱。在你的情況下,這適用於子域的區域(以及其他)。
example.com = @ IN A 1.2.3.4
www.example.com = www IN A 192.168.0.2
實例的原始DNS區域文件:
$TTL 14400
$ORIGIN example.com.
@ 1D IN SOA ns1.example.com. hostmaster.example.com. (
2002022401 ; serial
3H ; refresh
15 ; retry
1w ; expire
3h ; minimum
)
IN NS ns1.example.com. ; in the domain
IN NS ns2.smokeyjoe.com. ; external to domain
IN MX 10 mail.another.com. ; external mail provider
@ IN A 1.2.3.4 ; root record here would be value for example.com
ns1 IN A 192.168.0.1 ;name server definition
www IN A 192.168.0.2 ;web server definition
ftp IN CNAME www.example.com. ;ftp server definition
bill IN A 192.168.0.3
fred IN A 192.168.0.4
使用空白'@'的名字嗎? – 2013-04-05 15:53:44
@dirt所以我使用'@'作爲子域中的主機名? – memyself 2013-04-05 15:56:27
如果我正確理解你的問題,是的。對於'A'記錄的'name'值,使用'@'作爲''.subdomain.example''區域的根級別,可以在host中定義'subdomain.example.com'的IP。 subdomain.example'將定義「host.subdomain.example.com」的IP(去另一個級別,你可以創建主機作爲區域並需要'@ .host.subdomain.example') – 2013-04-05 15:59:41