创建 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