您的位置:首页 > 大数据 > 人工智能

/etc/resolv.conf中关键字search和domain的作用

2014-10-01 12:56 656 查看
domain 声明主机的域名。很多程序用到它,如邮件系统;当为没有域名的主机进行DNS 查询时,也要用到。如果没有域名,主机名将被使用,删除所有在第一个点( . )前面的内容。

search 它的多个参数指明域名查询顺序。当要查询没有域名的主机,主机将在由search 声明的域中分别查找。domain 和search 不能共存;如果同时存在,后面出现的将会被使用。

下面的说明更清晰

在/etc/resolv.conf 配置文件:domain 和search作用是一样的

domain linpro.no

search linpro.no uio.no ifi.uio.no

domain function:

Had I typed telnet math.uio.no. with the trailing dot, the resolver would have known it was an FQDN and would have looked up math.uio.no at once, without trying to append the specified domain
first. Not all applications are tolerant of the trailing dot, though, so it can't always be specified.

search function:

When ssh gram is executed, the resolver first looks for gram.linpro.no, which does not exist; thengram.uio.no, which does not exist, either; and finally gram.ifi.uio.no, which
will succeed because it does exist
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: