0 email linux bind dns-zone mx-record
使用 bind9 将 MX 记录添加到转发区域的正确方法(以及为什么)是什么?
选项 A
@ IN MX 10 mx1.example.com.
@ IN MX 20 mx2.example.com.
mx1.example.com. IN A a.b.c.d
mx2.example.com. IN A a.b.c.d
Run Code Online (Sandbox Code Playgroud)
选项 B
example.com. IN MX 10 mx1.example.com.
example.com. IN MX 20 mx2.example.com.
mx1.example.com. IN A a.b.c.d
mx2.example.com. IN A a.b.c.d
Run Code Online (Sandbox Code Playgroud)
或者还有其他选择吗?
$ORIGIN 定义了一个基值,在处理区域文件时,从该基值中进行“非限定”名称(没有终止点的名称)替换。该@符号是区域文件中 $ORIGIN 的简写。
因此,使用简写@或全名example.com.是等效的。
$ORIGIN 可以在区域文件中明确指定,但通常从绑定配置文件中指定的区域名称中隐含:
// named.conf file fragment
zone "example.com" in{
type master;
file "example.com.zone";
};
Run Code Online (Sandbox Code Playgroud)
和
; example.com.zone file fragment
; no $ORIGIN present and is synthesized from the zone name in named.conf ==> example.com
....
@ IN NS ns1.example.com.
; ns1.example.com. is the name server for example.com.
@ IN MX 10 mx1.example.com.
; mx1.example.com. is the primary mailserver name for example.com.
....
$ORIGIN uk.example.com.
; explicitly define or "reset" $ORIGIN to uk.example.com.
; doing this mid-way in a zone-file is not common practice anymore (if it ever was)
; but it will keep a large single zone-file somewhat more readable.
@ IN NS ns2.example.com.
; functionally identical to
; uk.example.com. IN NS ns2.example.com
; ns2.example.com. is the name server for uk.example.com.
Run Code Online (Sandbox Code Playgroud)
第三种选择是,区域文件中的一行既不以主机名、区域名称或@区域来源的简写开头,也可以成为上述记录的延续。
@ IN MX 10 mx1.example.com.
IN MX 20 mx2.example.com. ; another record for the @ record above
IN NS ns1.example.com. ; yet another record for the @ record above
IN NS ns2.example.com. ; and a 3rd continuation for the @ record above
Run Code Online (Sandbox Code Playgroud)
也相当于:
@ IN MX 10 mx1.example.com.
example.com. IN MX 20 mx2.example.com.
IN NS ns1.example.com. ; NS record for the example.com. record above
; the continuation can be to set different
; record types for the same resource record name
example.com. IN NS ns2.example.com.
www IN A 10.9.8.7
IN A 192.168.0.1 ; or set multiple (round-robin) records when
; continuing with the same record type.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1746 次 |
| 最近记录: |