BIND与DNS

版权声明:欢迎提问:[email protected] https://blog.csdn.net/include_heqile/article/details/84594379

DNS的运行机制

我们可以通过这张图来理解一下区域的差别

可以看到,ca域除了包含自己的数据(ca区域中的数据),还包含了ab.caon.caqc.ca区域中的所有数据

对于没有授权出去的子域,他们仍然是属于ca区域所有的,而已经授权出去的子域则被划出了界限,ca区域将不会再包含已经授权出去的数据,取而代之的是指向子域的指针,这些指针指向已被授权的子域的权威名称服务器

附加域名

之前学习Bind服务器配时,只知道域名都要写成完全合格域名格式,但是并不知道为什么

今天看了附加域名之后,就理解了,我们在主配置文件/etc/named.conf中有这么一段:

	zone "movie.edu" in {
		type master
		file "db.movie.edu"
	}

这一段话使得我们在db.movie.edu中可以简写域名

比如,原来的shrek.movie.edu.我们就可以写成shrek,注意原来是有.的

该域名是区域数据文件中所有数据的来源,这个来源会被附加到区域数据文件中所有不以.结尾的名称之后

也就是说如果我们没有加.的话

shrek.movie.edu  就会变成  shre.movie.edu.movie.edu

@符号的意义

https://en.wikipedia.org/wiki/Zone_file

wiki上给出的一个配置文件的例子:

$ORIGIN example.com.     ; designates the start of this zone file in the namespace
$TTL 1h                  ; default expiration time of all resource records without their own TTL value
example.com.  IN  SOA   ns.example.com. username.example.com. ( 2007120710 1d 2h 4w 1h )
example.com.  IN  NS    ns                    ; ns.example.com is a nameserver for example.com
example.com.  IN  NS    ns.somewhere.example. ; ns.somewhere.example is a backup nameserver for example.com
example.com.  IN  MX    10 mail.example.com.  ; mail.example.com is the mailserver for example.com
@             IN  MX    20 mail2.example.com. ; equivalent to above line, "@" represents zone origin
@             IN  MX    50 mail3              ; equivalent to above line, but using a relative host name

equivalent to above line, “@” represents zone origin

@符号所代表的意思由$ORIGIN关键字来指定

猜你喜欢

转载自blog.csdn.net/include_heqile/article/details/84594379