domain 聲明主機(jī)的域名。很多程序用到它,如郵件系統(tǒng);當(dāng)為沒(méi)有域名的主機(jī)進(jìn)行DNS 查詢時(shí),也要用到。如果沒(méi)有域名,主機(jī)名將被使用,刪除所有在第一個(gè)點(diǎn)( . )前面的內(nèi)容。search 它的多個(gè)參數(shù)指明域名查詢順序。當(dāng)要查詢沒(méi)有域名的主機(jī),主機(jī)將在由search 聲明的域中分別查找。domain 和search 不能共存;如果同時(shí)存在,后面出現(xiàn)的將會(huì)被使用。
下面的說(shuō)明更清晰
在/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
|