
/etc/resolv.conf
Linux 시스템의 파일 항목을 이해하려고 합니다 .
이 파일에는 키워드 및 값 목록이 포함되어 있습니다.
다음은 콘텐츠의 예입니다 /etc/resolv.conf
.
domain xxx.net
search xxx.net
nameserver 192.168.1.254
내가 아는 한, 이 nameserver
항목은 운영 체제가 DNS 쿼리를 해결하기 위해 사용하는 기본 이름 서버입니다.
내 질문은 핵심 작업 domain
과 search
관련 값이 무엇입니까?
답변1
다음 페이지에서 원하는 정보를 얻을 수 있습니다 man
.
man resolv.conf
...
domain Local domain name.
Most queries for names within this domain can use short names
relative to the local domain. If set to '.', the root domain is
considered. If no domain entry is present, the domain is deter‐
mined from the local hostname returned by gethostname(2); the
domain part is taken to be everything after the first '.'.
Finally, if the hostname does not contain a domain part, the
root domain is assumed.
search Search list for host-name lookup.
The search list is normally determined from the local domain
name; by default, it contains only the local domain name. This
may be changed by listing the desired domain search path follow‐
ing the search keyword with spaces or tabs separating the names.
Resolver queries having fewer than ndots dots (default is 1) in
them will be attempted using each component of the search path
in turn until a match is found. For environments with multiple
subdomains please read options ndots:n below to avoid man-in-
the-middle attacks and unnecessary traffic for the root-dns-
servers. Note that this process may be slow and will generate a
lot of network traffic if the servers for the listed domains are
not local, and that queries will time out if no server is avail‐
able for one of the domains.
The search list is currently limited to six domains with a total
of 256 characters.
따라서 domain xxx.net
해당 도메인이 있는 경우 해당 도메인의 항목을 나열하지 않고 참조할 수 있습니다. ping server_name.xxx.net
그렇지 않으면 ping server_name
둘 다 올바르게 해결됩니다.
search
domain
실패한 후 짧은 이름을 해결하려고 시도하는 다른 도메인의 목록입니다. 주요 차이점은 나열되지 않은 경우 명시적으로 나열되어야 하는 domain
로컬 호스트 이름을 기반으로 추측한다는 것입니다 .search