[AIX 네트워크 관리 14] TCP/IP (8) 이름 풀이: DNS 개념, 리졸버 순서, /etc/hosts
https://archive.horanglab.com/posts/aix-net-tcpip-8
핵심 정리
- 평면 네트워크는 호스트마다
/etc/hosts에 모든 호스트의 이름→주소를 두고, 계층 네트워크는 DNS(DOMAIN 프로토콜, named 데몬)로 이름 서버가 자기 영역(zone)의 이름을 풉니다. - 이름 규칙: 로컬 도메인 이름 64자 미만, 호스트 이름 32자 미만, 완전한 이름(FQDN) 255자 미만, 대소문자 구분 없음. 호스트 이름은 드문 단어나 주제어가 좋고, 흔한 단어·숫자만·문장 부호·대소문자 구분·사용자 이름·8자 넘는 이름·도메인처럼 보이는 이름은 피합니다.
- 이름 서버 종류: master(파일에서 적재, 권한 위임), slave(master에서 받아 SOA refresh나 Notify로 일련번호가 크면 다시 받음), stub(NS 레코드만), hint(캐시만), forwarder(로컬에서 못 푸는 질의를 지정 서버로 재귀 전달), remote(로컬 named 없이 다른 서버 사용). 레코드는 TTL 동안 캐시됩니다.
- 리졸버 기본 순서는 BIND/DNS → NIS →
/etc/hosts이며,/etc/resolv.conf가 없으면 DNS를 쓰지 않습니다. 순서는/etc/irs.conf(hosts dns continue/hosts local)나 환경 변수NSORDER=bind,local로 바꾸며,=auth를 붙인 서비스에서는 찾지 못해도 검색을 끝냅니다. - DNS 환경에서
hostname은 이름 서버가 돌려주는 공식(FQDN) 이름이어야 하며, 그렇지 않으면 sendmail.cf를 맞춰야 합니다. RARP 서버는arp로 만든 영구 항목만 씁니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (내용이 같음) |
| 원문 | Networks and communication management — 5.3판 133141쪽, 6.1판 179187쪽 |
| 파일 | /etc/hosts, /etc/resolv.conf, /etc/irs.conf, /etc/netsvc.conf, /etc/sendmail.cf |
| 관련 명령어 | hostent, hostname, arp, smit mkhostent, smit lshostent |
| 환경 변수 | NSORDER |
32비트 인터넷 주소는 기계가 인터네트워크로 보내는 데이터그램의 출발지와 목적지를 효율적으로 식별하게 하지만, 사용자는 뜻이 있고 기억하기 쉬운 이름을 좋아합니다. TCP/IP는 평면(flat) 네트워크 구조와 계층(hierarchical) 네트워크 구조를 모두 지원하는 이름 체계를 제공합니다.
평면 네트워크의 이름 짓기는 아주 간단합니다. 호스트 이름은 문자열 하나로 이루어지고 보통 로컬에서 관리합니다. 평면 TCP/IP 네트워크에서는 네트워크의 기계마다 네트워크의 모든 호스트에 대한 이름→인터넷 주소 대응 정보가 든 파일(/etc/hosts)이 있습니다. TCP/IP 네트워크가 커질수록 기계마다 이 이름 파일을 최신으로 유지하는 관리 부담이 커집니다. 인터넷처럼 TCP/IP 네트워크가 아주 커지면 이름 짓기를 계층으로 나눕니다. 보통 이 나눔은 네트워크 조직을 따릅니다. TCP/IP에서 계층 이름 짓기를 DNS(domain name system)라고 하며 DOMAIN 프로토콜을 씁니다. TCP/IP에서 DOMAIN 프로토콜은 named 데몬이 구현합니다.
평면 네트워크의 이름 짓기처럼 도메인 이름 계층도 네트워크와 호스트에 사용자가 기억하기 쉬운 뜻 있는 기호 이름을 줍니다. 그러나 네트워크의 기계마다 다른 모든 호스트의 이름→주소 대응이 든 파일을 유지하는 대신, 호스트 하나 이상을 이름 서버로 골라 씁니다. 이름 서버는 네트워크와 호스트에 준 기호 이름을 기계가 쓰는 효율적인 인터넷 주소로 바꿉니다(풉니다). 이름 서버는 도메인의 어떤 부분, 곧 영역(zone)에 관한 완전한 정보를 가지며 그 영역에 대한 권한(authority)이 있습니다.
영어 원문
TCP/IP name resolution
Although 32-bit Internet addresses provide machines an efficient means of identifying the source and destination of datagrams sent across an internetwork, users prefer meaningful, easily remembered names. Transmission Control Protocol/Internet Protocol (TCP/IP) provides a naming system that supports both flat and hierarchical network organizations.
Naming in flat networks is very simple. Host names consist of a single set of characters and generally are administered locally. In flat TCP/IP networks, each machine on the network has a file (/etc/hosts) containing the name-to-Internet-address mapping information for every host on the network. The administrative burden of keeping each machine naming file current grows as the TCP/IP network grows. WhenTCP/IP networks become very large, as on the Internet, naming is divided hierarchically. Typically, the divisions follow the network organization. In TCP/IP, hierarchical naming is known as the domain name system (DNS) and uses the DOMAIN protocol. The DOMAIN protocol is implemented by the named daemon in TCP/IP.
As in naming for flat networks, the domain name hierarchy provides for the assignment of symbolic names to networks and hosts that are meaningful and easy for users to remember. However, instead of each machine on the network keeping a file containing the name-to-address mapping for all other hosts on the network, one or more hosts are selected to function as name servers. Name servers translate (resolve) symbolic names assigned to networks and hosts into the efficient Internet addresses used by machines. A name server has complete information about some part of the domain, referred to as a zone, and it has authority for its zone.
이름 권한
평면 네트워크에서는 네트워크의 모든 호스트를 중앙 기관 하나가 관리합니다. 이런 네트워크에서는 모든 호스트의 이름이 고유해야 합니다. 큰 네트워크에서는 이 요구 사항이 중앙 기관에 큰 관리 부담이 됩니다.
도메인 네트워크에서는 호스트 묶음을 나무 구조의 도메인과 하위 도메인 계층 안에서 따로 관리합니다. 이때 호스트 이름은 로컬 도메인 안에서만 고유하면 되고, 루트 도메인만 중앙 기관이 관리합니다. 이 구조 덕분에 하위 도메인을 로컬에서 관리할 수 있어 중앙 기관의 부담이 줄어듭니다. 예를 들어 인터넷의 루트 도메인은 com(상업 조직), edu(교육 조직), gov(정부 조직), mil(군) 같은 도메인으로 이루어집니다. 새 최상위 도메인은 중앙 기관만 더할 수 있습니다. 두 번째 수준의 이름 짓기는 각 도메인 안의 지정된 대리인에게 위임됩니다. 예를 들어 다음 그림에서 com은 그 아래 모든 상업 조직 하위 도메인의 이름 권한을 가집니다. 마찬가지로 세 번째 수준(그 아래도) 이름 짓기는 그 수준의 대리인에게 위임됩니다. 예를 들어 인터넷 도메인 구조 그림에서 Century는 하위 도메인 Austin, Hopkins, Charlotte의 이름 권한을 가집니다.
root
┌───────────┼───────────┐
mil com edu
│
century
┌───────────┼───────────┐
Charlotte Austin Hopkins
┌────┴────┐
Dev Graphics
그림 24. 인터넷의 도메인 구조(원문 그림을 글자로 다시 그림)
Century의 Austin 하위 도메인은 다시 Dev와 Graphics 같은 영역으로 나눌 수 있습니다. 이때 영역 austin.century.com에는 Dev와 Graphics에 위임한 것을 뺀, 도메인 austin.century.com의 모든 데이터가 들어 있습니다. 영역 dev.century.com에는 Dev에 위임한 데이터만 들어 있으며, 예를 들어 Graphics에 관해서는 아무것도 모릅니다. (같은 이름의 도메인과 달리) 영역 austin.century.com에는 다른 영역에 위임하지 않은 데이터만 들어 있습니다.
영어 원문
Naming authority
In a flat network, all hosts in the network are administered by one central authority. This form of network requires that all hosts in the network have unique host names. In a large network, this requirement creates a large administrative burden on the central authority.
In a domain network, groups of hosts are administered separately within a tree-structured hierarchy of domains and subdomains. In this case, host names need to be unique only within the local domain, and only the root domain is administered by a central authority. This structure allows subdomains to be administered locally and reduces the burden on the central authority. For example, the root domain of the Internet consists of such domains as com (commercial organizations), edu (educational organizations), gov (governmental organizations), and mil (military groups). New top-level domains can only be added by
the central authority. Naming at the second level is delegated to designated agents within the respective domains. For example, in the following figure, com has naming authority for all commercial organization subdomains beneath it. Likewise, naming at the third level (and so on) is delegated to agents within that level. For example, in the Domain Structure of the Internet figure, Century has naming authority for its subdomains Austin, Hopkins, and Charlotte.
This figure illustrates the hierarchical structure of the internet. It begins at the top with the root and branches to the next level containing the mil, com, and edu domains. Below the com domain is another level containing Charlotte, Austin, and Hopkins. Below Austin is Dev and Graphics.
Century's Austin subdomain might also be divided into zones, for example, Dev and Graphics. In this case, the zone austin.century.com has all the data contained in the domain austin.century.com, except that which was delegated to Dev and Graphics. The zone dev.century.com would contain only the data delegated to Dev; it would know nothing about Graphics, for example. The zone austin.century.com (as opposed to the domain of the same name) would contain only that data not delegated to other zones.
이름 규칙
계층 도메인 이름 체계에서 이름은 대소문자를 구분하지 않는 하위 이름들을 마침표로 구분해 이은 것이며, 중간에 공백이 없습니다.
DOMAIN 프로토콜은 로컬 도메인 이름은 64자 미만, 호스트 이름은 32자 미만이어야 한다고 정합니다. 호스트 이름이 맨 앞에 오고, 마침표(.), 마침표로 구분한 로컬 도메인 이름들, 마지막으로 루트 도메인이 옵니다. 마침표를 포함한 호스트의 완전한 도메인 이름은 255자 미만이어야 하며 다음 형식입니다.
host.subdomain1.[subdomain2 . . . subdomain].rootdomain
호스트 이름은 도메인 안에서 고유해야 하므로, 같은 도메인의 호스트에 메시지를 보낼 때는 줄인 이름을 쓸 수 있습니다. 예를 들어 eng 도메인의 호스트는 smith.eng.lsu.edu 대신 smith로 메시지를 보낼 수 있습니다. 또 호스트마다 다른 호스트가 메시지를 보낼 때 쓸 수 있는 별칭(alias)을 여러 개 가질 수 있습니다.
영어 원문
Naming conventions
In the hierarchical domain name system, names consist of a sequence of case-insensitive subnames separated by periods with no embedded blanks.
The DOMAIN protocol specifies that a local domain name must be fewer than 64 characters and that a host name must be fewer than 32 characters in length. The host name is given first, followed by a period (.), a series of local domain names separated by periods, and finally the root domain. A fully specified domain name for a host, including periods, must be fewer than 255 characters in length and in the following form:
host.subdomain1.[subdomain2 . . . subdomain].rootdomain
Because host names must be unique within a domain, you can use an abbreviated name when sending messages to a host within the same domain. For example, instead of sending a message to Figure 24. Domain structure of the Internet
smith.eng.lsu.edu, a host in the eng domain could send a message to smith. Additionally, each host can have several aliases that other hosts can use when sending messages.
네트워크의 호스트 이름 짓기
호스트에 이름을 쓰는 목적은 네트워크의 컴퓨터를 빠르고, 쉽고, 헷갈림 없이 가리키는 것입니다. 인터넷 시스템 관리자들은 호스트 이름에 좋은 선택과 나쁜 선택이 있다는 것을 알게 되었습니다. 다음 제안은 호스트 이름을 고를 때 흔한 함정을 피하도록 돕습니다.
헷갈리지 않고 기억하기 쉬운 호스트 이름을 고르는 제안입니다.
- 드물게 쓰는 단어. 예:
sphinx,eclipse - 주제가 있는 이름. 색, 원소(예:
helium,argon,zinc), 꽃, 물고기 등 - (무작위 문자열이 아닌) 실제 단어
나쁜 선택의 예입니다. 대체로 기억하기 어렵거나 (사람이나 컴퓨터에게) 헷갈리기 때문입니다.
- 이미 흔히 쓰는 단어. 예:
up,down,crash - 숫자로만 된 이름
- 문장 부호가 든 이름
- 대소문자 구분에 기대는 이름. 예:
Orange와orange - 시스템 주 사용자의 이름이나 머리글자
- 8자가 넘는 이름
- 특이하거나 일부러 틀린 철자. 예: "check"나 "czech"와 헷갈릴 수 있는
czek - 도메인 이름이거나 도메인 이름과 비슷한 이름. 예:
yale.edu
영어 원문
Naming hosts on your network
The purpose of using names for hosts is to provide a quick, easy, and unambiguous way to refer to the computers in your network. Internet system administrators have discovered that there are good, as well as poor, choices for host names. These suggestions are intended to help you avoid common pitfalls in choosing host names.
The following are some suggestions for choosing unambiguous, easy to remember host names:
Terms that are rarely used, for example,
sphinxoreclipse.Theme names, such as colors, elements (for example,
helium,argon, orzinc), flowers, fish, and others.Real words (as opposed to random strings of characters).
The following are some examples of poor choices. In general, these are poor choices because they are difficult to remember or are confusing (either to humans or computers):
Terms that are already in common use, for example,
up,down, orcrash.Names containing only numbers.
Names that contain punctuation marks.
Names that rely on case distinction, for example,
Orangeandorange.The name or initials of the primary user of the system.
Names having more than 8 characters.
Unusual or purposefully incorrect spellings, for example,
czek, which could be confused with "check" or "czech."Names that are, or resemble, domain names, for example,
yale.edu.
이름 서버
평면 이름 공간에서는 모든 이름을 네트워크의 호스트마다 /etc/hosts 파일에 두어야 합니다. 네트워크가 아주 크면 각 기계의 자원에 부담이 될 수 있습니다. 계층 네트워크에서는 이름 서버로 지정한 일부 호스트가 다른 호스트를 위해 이름을 인터넷 주소로 풉니다.
이는 평면 이름 공간보다 두 가지 이점이 있습니다. 네트워크의 각 호스트 자원이 이름 풀이에 묶이지 않게 하고, 시스템 관리자가 네트워크의 기계마다 이름 풀이 파일을 유지하지 않아도 되게 합니다. 이름 서버 하나가 관리하는 이름 묶음을 그 서버의 권한 영역(zone of authority)이라고 합니다.
참고: 권한 영역의 이름 풀이 기능을 하는 호스트 기계를 흔히 이름 서버 호스트라고 부르지만, 그 기능을 제어하는 프로세스인 named 데몬이 실제 이름 서버 프로세스입니다.
불필요한 네트워크 활동을 더 줄이려고 모든 이름 서버는 이름→주소 대응을 캐시(한동안 저장)합니다. 클라이언트가 서버에 이름 풀이를 요청하면 서버는 먼저 캐시에서 그 이름을 최근에 풀었는지 확인합니다. 도메인과 호스트 이름은 바뀌므로 각 항목은 레코드의 TTL이 정한 제한된 시간 동안만 캐시에 남습니다. 이렇게 해서 권한 기관이 이름 풀이가 얼마 동안 정확하리라 보는지 지정할 수 있습니다.
자율 시스템 안에는 이름 서버가 여럿 있을 수 있습니다. 보통 이름 서버는 계층으로 구성되며 네트워크 조직에 대응합니다. "인터넷의 도메인 구조" 그림을 보면, 도메인마다 그 안의 모든 하위 도메인을 맡는 이름 서버가 있을 수 있습니다. 하위 도메인 이름 서버는 위 도메인의 이름 서버(부모 이름 서버)와 통신하고, 다른 하위 도메인의 이름 서버와도 통신합니다.
예를 들어 그림에서 Austin, Hopkins, Charlotte는 모두 도메인 Century의 하위 도메인입니다. 네트워크 설계가 나무 계층을 따르면 Austin 이름 서버는 Charlotte와 Hopkins의 이름 서버, 그리고 부모인 Century 이름 서버와 통신합니다. Austin 이름 서버는 자기 하위 도메인을 맡은 이름 서버와도 통신합니다.
이름 서버의 종류는 다음과 같습니다.
| 종류 | 설명 |
|---|---|
| Master Name Server | 파일이나 디스크에서 데이터를 적재하며, 자기 도메인의 다른 서버에 권한을 위임할 수 있습니다. |
| Slave Name Server | 시스템 시작 때 master 이름 서버에서 해당 권한 영역의 정보를 받고, 그 뒤 주기적으로 master 서버에 정보를 갱신해 달라고 요청합니다. slave 이름 서버에서 SOA(start of authority) 리소스 레코드의 refresh 값이 만료되거나 master 이름 서버에서 Notify 메시지를 받으면, master의 데이터베이스 일련번호가 slave의 현재 데이터베이스 일련번호보다 크면 master에서 데이터베이스를 다시 적재합니다. master에서 영역 전송을 강제로 다시 받아야 하면 기존 slave 데이터베이스를 지우고 slave 이름 서버의 named 데몬을 새로 고치면 됩니다. |
| Stub Name Server | 데이터베이스 복제 방법은 slave 이름 서버와 비슷하지만 master 데이터베이스 전체가 아니라 이름 서버(NS) 레코드만 복제합니다. |
| Hint Server | 앞서 다른 이름 서버에 물어 만든 힌트에만 기대는 이름 서버입니다. 캐시에 이름→주소 대응이 없으면 필요한 정보를 줄 권한이 있는 다른 서버에 물어 질의에 답합니다. |
| Forwarder 또는 Client Server | 로컬에서 답할 수 없는 질의를 정해 둔 전달 서버 목록으로 보냅니다. 전달 전용 서버(정보를 얻어 다른 클라이언트에 넘기지만 실제 서버는 아닌 forwarder)는 루트 도메인과 다른 도메인의 master 이름 서버와 주고받지 않습니다. 전달 서버로 가는 질의는 재귀적입니다. 전달 서버는 하나 이상일 수 있으며 목록이 바닥날 때까지 차례로 시도합니다. 클라이언트와 forwarder 구성은 보통 한 사이트의 모든 서버가 나머지 인터넷 서버와 주고받지 않게 하거나, 일부 이름 서버에 큰 캐시를 만들 때 씁니다. |
| Remote Server | 로컬 호스트에서 이름 서버 프로세스를 실행하지 않고 이름 서버를 쓰는 모든 네트워크 프로그램을 실행합니다. 모든 질의는 네트워크의 다른 기계에서 실행 중인 이름 서버가 처리합니다. |
이름 서버 호스트 하나가 권한 영역마다 다른 역할을 할 수 있습니다. 예를 들어 이름 서버 호스트 하나가 한 영역에는 master 이름 서버, 다른 영역에는 slave 이름 서버일 수 있습니다.
영어 원문
Name servers
In a flat name space, all names must be kept in the /etc/hosts file on each host on the network. If the network is very large, this can become a burden on the resources of each machine. In a hierarchical network, certain hosts designated as name servers resolve names into Internet addresses for other hosts.
This has two advantages over the flat name space. It keeps the resources of each host on the network from being tied up in resolving names, and it keeps the person who manages the system from having to maintain name resolution files on each machine on the network. The set of names managed by a single name server is known as its zone of authority.
Note: Although the host machine that performs the name resolution function for a zone of authority is commonly referred to as a name server host, the process controlling the function, the named daemon, is the actual name server process.
To further reduce unnecessary network activity, all name servers cache (store for a period of time) name-to-address mappings. When a client asks a server to resolve a name, the server checks its cache first to see if the name has been resolved recently. Because domain and host names do change, each item remains in the cache for a limited length of time specified by the TTL of the record. In this way, authorities can specify how long they expect the name resolution to be accurate.
Within any autonomous system there can be multiple name servers. Typically, name servers are organized hierarchically and correspond to the network organization. Referring to the "Domain Structure of the Internet" figure, each domain might have a name server responsible for all subdomains within the domain. Each subdomain name server communicates with the name server of the domain above it (called the parent name server), as well as with the name servers of other subdomains.
This figure illustrates the hierarchical structure of the internet. It begins at the top with the root and branches to the next level containing the mil, com, and edu domains. Below the com domain is another level containing Charlotte, Austin, and Hopkins. Below Austin is Dev and Graphics.
For example, in the "Domain Structure of the Internet" figure, Austin, Hopkins, and Charlotte are all subdomains of the domain Century. If the tree hierarchy is followed in the network design, the Austin name server communicates with the name servers of Charlotte and Hopkins as well as with the parent Century name server. The Austin name server also communicates with the name servers responsible for its subdomains.
There are several types of name servers:
- Master Name Server — Loads its data from a file or disk and can delegate authority to other servers in its domain.
- Slave Name Server — Receives its information at system startup time for the given zone of authority from a master name server, and then periodically asks the master server to update its information. On expiration of the refresh value in the start of authority (SOA) Resource Record on a slave name server, or on receipt of a Notify message from the master name server, the slave reloads the database from the master if the serial number of the database on the master is greater than the serial number in the current database on the slave. If it becomes necessary to force a new zone transfer from the master, simply remove the existing slave databases and refresh the named daemon on the slave name server.
- Stub Name Server — Although its method of database replication is similar to that of the slave name server, the stub name server only replicates the name server records of the master database rather than the whole database.
- Hint Server — Indicates a name server that relies only on the hints that it has built from previous queries to other name servers. The hint name server responds to queries by asking other servers that have the authority to provide the information needed if a hint name server does not have a name-to-address mapping in its cache.
Figure 25. Domain structure of the Internet
- Forwarder or Client Server — Forwards queries it cannot satisfy locally to a fixed list of forwarding servers. Forwarding-only servers (a forwarder that obtains information and passes it on to other clients, but that is not actually a server) does not interact with the master name servers for the root domain and other domains. The queries to the forwarding servers are recursive. There can be one or more forwarding servers, which are tried in turn until the list is exhausted. A client and forwarder configuration is typically used when you do not want all the servers at a given site to interact with the rest of the Internet servers, or when you want to build a large cache on a select number of name servers.
- Remote Server — Runs all the network programs that use the name server without the name server process running on the local host. All queries are serviced by a name server that is running on another machine on the network.
One name server host can perform in different capacities for different zones of authority. For example, a single name server host can be a master name server for one zone and a slave name server for another zone.
이름 풀이
호스트 이름에서 인터넷 주소를 얻는 과정을 이름 풀이라고 하며 gethostbyname 서브루틴이 합니다.
인터넷 주소를 호스트 이름으로 바꾸는 과정을 역(reverse) 이름 풀이라고 하며 gethostbyaddr 서브루틴이 합니다. 이 루틴들은 사실상 리졸버(resolver)라는 이름 변환 루틴 라이브러리에 접근하는 함수입니다.
TCP/IP를 실행하는 호스트의 리졸버 루틴은 보통 다음 출처로 이름을 풀려고 합니다.
- BIND/DNS(named)
- NIS(Network Information Service)
- 로컬
/etc/hosts파일
NIS+가 설치되어 있으면 조회 순서는 irs.conf 파일로 정합니다. 자세한 내용은 Network Information Services (NIS and NIS+) Guide를 봅니다.
도메인 네트워크에서 이름을 풀 때 리졸버 루틴은 먼저 도메인 이름 서버 데이터베이스에 묻습니다. 호스트가 도메인 이름 서버면 로컬에, 아니면 외부 호스트에 있습니다. 이름 서버는 도메인 이름을 인터넷 주소로 바꿉니다. 이름 서버가 맡는 이름 묶음이 그 서버의 권한 영역입니다. 리졸버 루틴이 원격 이름 서버를 쓰면 도메인 이름 프로토콜(DOMAIN)로 대응을 묻습니다. 평면 네트워크에서 이름을 풀 때 리졸버 루틴은 로컬 /etc/hosts 파일에서 항목을 찾습니다. NIS나 NIS+를 쓰면 master 서버의 /etc/hosts 파일을 찾습니다.
기본으로 리졸버 루틴은 위 자원으로 이름을 풀려고 합니다. BIND/DNS를 먼저 시도합니다. /etc/resolv.conf 파일이 없거나 BIND/DNS가 이름을 찾지 못하면, NIS가 실행 중이면 NIS에 묻습니다. NIS는 로컬 /etc/hosts보다 권한이 있으므로 NIS가 실행 중이면 검색이 여기서 끝납니다. NIS가 실행 중이 아니면 로컬 /etc/hosts 파일을 찾습니다. 이 서비스 가운데 어느 것도 이름을 찾지 못하면 리졸버 루틴은 HOST_NOT_FOUND를 돌려줍니다. 모든 서비스를 쓸 수 없으면 SERVICE_UNAVAILABLE을 돌려줍니다.
위의 기본 순서는 /etc/irs.conf 구성 파일을 만들어 원하는 순서를 지정하면 덮어쓸 수 있습니다. 또 기본 순서와 /etc/irs.conf 순서 모두 환경 변수 NSORDER로 덮어쓸 수 있습니다. /etc/irs.conf 파일이나 NSORDER 환경 변수를 정의하면 옵션과 함께 값을 적어도 하나 지정해야 합니다.
/etc/irs.conf 파일로 호스트 순서를 지정하는 형식입니다.
hosts value [ continue ]
방법마다 한 줄에 하나씩 적어 순서를 정합니다. value는 위 방법 가운데 하나이고, continue 키워드는 다음 줄에 다른 리졸버 방법이 이어진다는 뜻입니다.
NSORDER 환경 변수로 호스트 순서를 지정하는 형식입니다.
NSORDER= value , value , value
순서는 한 줄에 쉼표로 값을 구분해 적습니다. 쉼표와 등호 사이에 공백을 넣어도 됩니다.
예를 들어 로컬 네트워크가 평면 네트워크로 구성되어 있으면 /etc/hosts 파일만 있으면 됩니다. 이 경우 /etc/irs.conf 파일에는 다음 줄이 들어갑니다.
hosts local
또는 NSORDER 환경 변수를 다음처럼 설정할 수 있습니다.
NSORDER=local
로컬 네트워크가 이름 풀이에 이름 서버를 쓰고 백업으로 /etc/hosts 파일을 쓰는 도메인 네트워크라면 두 서비스를 모두 지정해야 합니다. 이 경우 /etc/irs.conf 파일에는 다음 줄들이 들어갑니다.
hosts dns continue
hosts local
NSORDER 환경 변수는 다음처럼 설정합니다.
NSORDER=bind,local
참고: 값은 소문자로 적어야 합니다.
정의했거나 기본인 리졸버 순서를 따를 때 검색 알고리즘은 다음 경우에만 다음 리졸버로 넘어갑니다.
- 현재 서비스가 실행 중이 아니어서 쓸 수 없을 때
- 현재 서비스가 이름을 찾지 못했고 권한이 없을 때
/etc/resolv.conf 파일이 없으면 BIND/DNS가 설정되지 않았거나 실행 중이 아닌 것으로 보아 쓸 수 없다고 판단합니다. getdomainname과 yp_bind 서브루틴이 실패하면 NIS 서비스가 설정되지 않았거나 실행 중이 아닌 것으로 보아 쓸 수 없다고 판단합니다. /etc/hosts 파일을 열 수 없으면 로컬 검색을 할 수 없으므로 그 파일과 서비스를 쓸 수 없다고 판단합니다.
서비스를 권한 있음(authoritative)으로 지정하면, 그 서비스가 뒤따르는 서비스보다 전문이고 관련된 이름과 주소를 모두 가지고 있다는 뜻입니다. 뒤따르는 서비스는 권한 있는 서비스 정보의 일부만 가지고 있을 수 있으므로 리졸버 루틴은 뒤따르는 서비스를 시도하지 않습니다. 이름 풀이는 이름을 찾지 못하더라도 권한 있음으로 지정한 서비스에서 끝납니다(이때 리졸버 루틴은 HOST_NOT_FOUND를 돌려줍니다). 권한 있는 서비스를 쓸 수 없으면 지정된 다음 서비스에 묻습니다.
권한 있는 출처는 값 바로 뒤에 =auth 문자열을 붙여 지정합니다. authoritative라고 다 적어도 되지만 auth 문자열만 씁니다. 예를 들어 NSORDER 환경 변수에 다음이 들어 있으면
hosts = nis=auth,dns,local
(NIS가 실행 중이면) 이름을 찾았든 못 찾았든 NIS 질의 뒤에 검색이 끝납니다. NIS가 실행 중이 아니면 다음 출처인 DNS에 묻습니다.
TCP/IP 이름 서버는 원격 네트워크의 호스트 이름을 찾는 비용을 줄이려고 캐시를 씁니다. 요청마다 호스트 이름을 찾는 대신, 이름 서버는 먼저 캐시를 보고 그 호스트 이름을 최근에 풀었는지 확인합니다. 도메인과 호스트 이름은 바뀌므로 각 항목은 레코드의 TTL(time-to-live) 값이 정한 제한된 시간 동안만 캐시에 남습니다. 이렇게 해서 이름 서버는 자기 응답을 얼마 동안 권한 있는 것으로 볼지 지정할 수 있습니다.
이름 서버와 sendmail 사이의 호스트 이름 충돌 가능성
DNS 환경에서 명령줄의 hostname 명령이나 rc.net 파일로 설정한 호스트 이름은 이름 서버가 돌려주는 호스트의 공식 이름이어야 합니다.
보통 이 이름은 다음 형식의 호스트의 완전한 도메인 이름입니다.
host.subdomain.subdomain.rootdomain
참고: 리졸버 루틴은 기본 도메인이 설정되어 있어야 합니다. hostname 명령에서 기본 도메인을 설정하지 않았으면 /etc/resolv.conf 파일에서 설정해야 합니다.
호스트 이름을 완전한 도메인 이름으로 설정하지 않았고 시스템이 sendmail 프로그램과 함께 도메인 이름 서버를 쓰도록 설정되어 있으면, sendmail 구성 파일(/etc/sendmail.cf)을 이 공식 호스트 이름에 맞게 고쳐야 합니다. 또 sendmail 프로그램이 제대로 동작하려면 이 구성 파일의 도메인 이름 매크로를 설정해야 합니다.
참고: 모든 sendmail 기능에서 /etc/sendmail.cf 파일에 지정한 도메인이 hostname 명령으로 설정한 도메인보다 우선합니다.
이름 서버와 sendmail 사이의 도메인 이름 충돌 가능성
로컬 도메인 이름과 도메인 이름 서버는 호스트가 DOMAIN 이름 서버인지에 따라 다른 파일에 지정합니다.
DOMAIN 네트워크에 있지만 이름 서버가 아닌 호스트는 /etc/resolv.conf 파일에 로컬 도메인 이름과 도메인 이름 서버를 지정합니다. DOMAIN 이름 서버 호스트에서는 named 데몬이 시작할 때 읽는 파일에 로컬 도메인과 다른 이름 서버를 정의합니다.
영어 원문
Name resolution
The process of obtaining an Internet address from a host name is known as name resolution and is done by the gethostbyname subroutine.
The process of translating an Internet address into a host name is known as reverse name resolution and is done by the gethostbyaddr subroutine. These routines are essentially accessors into a library of name translation routines known as resolvers.
Resolver routines on hosts running TCP/IP normally attempt to resolve names using the following sources:
BIND/DNS (named)
Network Information Service (NIS)
Local
/etc/hostsfile
When NIS+ is installed, lookup preferences are set using the irs.conf file. For more information, see Network Information Services (NIS and NIS+) Guide.
To resolve a name in a domain network, the resolver routine first queries the domain name server database, which might be local if the host is a domain name server or on a foreign host. Name servers translate domain names into Internet addresses. The group of names for which a name server is responsible is its zone of authority. If the resolver routine is using a remote name server, the routine uses the domain name protocol (DOMAIN) to query for the mapping. To resolve a name in a flat network, the resolver routine checks for an entry in the local /etc/hosts file. When NIS or NIS+ is used, the /etc/hosts file on the master server is checked.
By default, resolver routines attempt to resolve names using the above resources. BIND/DNS is tried first. If the /etc/resolv.conf file does not exist or if BIND/DNS could not find the name, NIS is queried if it is running. NIS is authoritative over the local /etc/hosts, so the search ends here if it is running. If NIS is not running, then the local /etc/hosts file is searched. If none of these services can find the name, then the resolver routines return with HOST_NOT_FOUND. If all of the services are unavailable, then the resolver routines return with SERVICE_UNAVAILABLE.
The default order described above can be overwritten by creating the /etc/irs.conf configuration file and specifying the desired order. Also, both the default and /etc/irs.conf orderings can be overwritten with the environment variable, NSORDER. If either the /etc/irs.conf file or NSORDER environment variable are defined, then at least one value must be specified along with the option.
To specify host ordering with the /etc/irs.conf file:
hosts value [ continue ]
The order is specified with each method indicated on a line by itself. The value is one of the listed methods and the continue keyword indicates that another resolver method follows on the next line.
To specify host ordering with the NSORDER environment variable:
NSORDER= value , value , value
The order is specified on one line with values separated by commas. White spaces are permitted between the commas and the equal sign.
For example, if the local network is organized as a flat network, then only the /etc/hosts file is needed. Given this example, the /etc/irs.conf file contains the following line:
hosts local
Alternatively, the NSORDER environment variable can be set as:
NSORDER=local
If the local network is a domain network using a name server for name resolution and an /etc/hosts file for backup, then both services should be specified. Given this example, the /etc/irs.conf file contains the following lines:
hosts dns continue
hosts local
The NSORDER environment variable is set as:
NSORDER=bind,local
Note: The values listed must be in lowercase.
When following any defined or default resolver ordering, the search algorithm continues from one resolver to the next only if:
The current service is not running, therefore, it is unavailable.
The current service cannot find the name and is not authoritative.
If the /etc/resolv.conf file does not exist, then BIND/DNS is considered not set up or running, and therefore it is not available. If the getdomainname and yp_bind subroutines fail, then the NIS service is considered not set up or running, and therefore it is not available. If the /etc/hosts file could not be opened, then a local search is impossible, and therefore the file and service are unavailable.
When a service is listed as authoritative, it means that this service is the expert of its successors and has all pertinent names and addresses. Resolver routines do not try successor services, because successors might contain only a subset of the information in the authoritative service. Name resolution ends at service listed as authoritative, even if it does not find the name (in which case, the resolver routine returns HOST_NOT_FOUND). If an authoritative service is not available, then the next service specified is queried.
An authoritative source is specified with the string =auth directly behind a value. The entire word, authoritative can be typed in, but only the auth string is used. For example, if the NSORDER environment variable contains the following:
hosts = nis=auth,dns,local
The search ends after the NIS query (if NIS is running), regardless of whether the name was found. If NIS is not running, then the next source is queried, which is DNS.
TCP/IP name servers use caching to reduce the cost of searching for names of hosts on remote networks. Instead of searching for a host name each time a request is made, a name server first looks at its cache to see if the host name has been resolved recently. Because domain and host names do change, each item remains in the cache for a limited length of time specified by the time-to-live (TTL) value of the record. In this way, name servers can specify how long they expect their responses to be considered authoritative.
Potential host name conflict between name server and sendmail:
In a DNS environment, a host name that is set using the hostname command from the command line or in the rc.net file format must be the official name of the host as returned by the name server.
Generally, this name is the full domain name of the host in the form:
host.subdomain.subdomain.rootdomain
Note: Resolver routines require the default domain to be set. If the default domain is not set in the hostname command, then it must be set in the /etc/resolv.conf file.
If the host name is not set up as a fully qualified domain name, and if the system is set up to use a domain name server in conjunction with the sendmail program, the sendmail configuration file (/etc/sendmail.cf) must be edited to reflect this official host name. In addition, the domain name macros in this configuration file must be set for the sendmail program to operate correctly.
Note: The domain specified in the /etc/sendmail.cf file takes precedence over the domain set by the hostname command for all sendmail functions.
Potential domain name conflict between name server and sendmail:
Local domain names and domain name servers are specified in different files, depending on whether the host is a DOMAIN name server.
For a host that is in a DOMAIN network but is not a name server, the local domain name and domain name server are specified in the /etc/resolv.conf file. In a DOMAIN name server host, the local domain and other name servers are defined in files read by the named daemon when it starts.
RARP(Reverse Address Resolution Protocol)
RARP는 이더넷 LAN 어댑터(이더넷 프로토콜만)에서 고유한 하드웨어 주소를 인터넷 주소로 바꿉니다.
표준 이더넷 프로토콜을 다음 제한과 함께 지원합니다.
- 서버는 RARP 요청에만 응답합니다.
- 서버는 영구 ARP 표 항목만 씁니다.
- 서버는 동적 ARP 표 항목을 쓰지 않습니다.
- 서버는 자기 자신에 대해 자동으로 응답하지 않습니다.
시스템 관리자는 arp 명령으로 영구 ARP 항목 표를 손으로 만들고 유지해야 합니다. 권한 있는 출처에서 RARP 응답을 받아야 하는 호스트마다 서버에 ARP 표 항목을 더해야 합니다.
영어 원문
Reverse Address Resolution Protocol
The Reverse Address Resolution Protocol (RARP) translates unique hardware addresses into Internet addresses on the Ethernet local area network (LAN) adapter (Ethernet protocol only).
Standard Ethernet protocol is supported with the following restrictions:
The server only replies to RARP requests.
The server only uses permanent ARP table entries.
The server does not use dynamic ARP table entries.
The server does not automatically reply for itself.
The system administrator must manually build and maintain a table of permanent ARP entries using the arp command. A specific ARP table entry must be added on the server for each host that requires RARP replies from an authoritative source.
로컬 이름 풀이(/etc/hosts) 작업
네트워크가 작고 평면 이름 체계를 쓰면 /etc/hosts 파일을 구성합니다.
이름 서버를 쓰는 계층(도메인) 이름 체계를 쓰더라도, 이름 서버가 모르는 호스트를 나타내려고 /etc/hosts 파일을 구성할 수 있습니다.
Web-based System Manager, SMIT, 명령으로 로컬 호스트 풀이를 구성합니다. 명령을 쓴다면 Files Reference의 Hosts File Format for TCP/IP에 설명된 /etc/hosts 파일 형식을 지켜야 합니다.
표 63. 로컬 이름 풀이 작업
| 작업 | SMIT 빠른 경로 | 명령이나 파일 |
|---|---|---|
| 모든 호스트 나열 | smit lshostent |
hostent 명령을 쓰거나 /etc/hosts를 봅니다. |
| 호스트 더하기 | smit mkhostent |
hostent 명령을 쓰거나 /etc/hosts를 편집합니다. |
| 호스트 특성 바꾸기·보기 | smit chhostent |
hostent 명령을 쓰거나 /etc/hosts를 편집합니다. |
| 호스트 지우기 | smit rmhostent |
hostent 명령을 쓰거나 /etc/hosts를 편집합니다. |
Web-based System Manager에서는 Software > Network > TCPIP (IPv4 and IPv6) > TCPIP Protocol Configuration > TCP/IP > Configure TCP/IP > Advanced Methods > Hosts File로 들어갑니다. 목록은 Contents of /etc/hosts file에서 보고, 더하거나 바꿀 때는 Add/Change host entry에서 IP Addresses, Host name, Alias(es), Comment를 채운 뒤 Add/Change Entry > OK를, 지울 때는 호스트를 고르고 Delete Entry > OK를 누릅니다.
영어 원문
Local name resolution (/etc/hosts) tasks
Configure the /etc/hosts file if your network is small, and you are using a flat naming scheme.
Even if you are using a hierarchical (or domain) naming scheme with name servers, you might want to configure the /etc/hosts file to identify hosts that are not known by the name servers.
Configure your system for local host resolution using the Web-based System Manager, the System Management Interface Tool (SMIT), or commands. If you choose the command method, be sure to preserve the format of the /etc/hosts file, as described in Hosts File Format for TCP/IP in the Files Reference.
Table 63. Local name resolution tasks
| Task | SMIT fast path | Command or file |
|---|---|---|
| Web-based System Manager Management Environment | ||
| List All the Hosts | smit lshostent | Use the hostent command or view /etc/hosts Software > Network > TCPIP (IPv4 and IPv6) > TCPIP Protocol Configuration > TCP/IP > Configure TCP/IP > Advanced Methods > Hosts File > Contents of /etc/hosts file. |
| Add a Host | smit mkhostent | Use the hostent command or edit /etc/hosts Software > Network > TCPIP (IPv4 and IPv6) > TCPIP Protocol Configuration > TCP/IP > Configure TCP/IP > Advanced Methods > Hosts File. In Add/Change host entry, complete the following fields: IP Addresses, Host name, Alias(es), and Comment. Click Add/Change Entry > OK. |
| Change/Show Characteristics | ||
| of a Host | smit chhostent | Use the hostent command or edit /etc/hosts Software > Network > TCPIP (IPv4 and IPv6) > TCPIP Protocol Configuration > TCP/IP > Configure TCP/IP > Advanced Methods > Hosts File. Select a host in Contents of /etc/hosts/file, and change data in Add/Change host entry. Click Add/Change Entry > OK. |
| Remove a Host | smit rmhostent | Use the hostent command or edit /etc/hosts Software > Network > TCPIP (IPv4 and IPv6) > TCPIP Protocol Configuration > TCP/IP > Configure TCP/IP > Advanced Methods > Hosts File. Select a host in Contents of /etc/hosts/file, and click Delete Entry > OK. |
DOMAIN 이름 풀이 계획
DOMAIN 이름 풀이 시스템을 계획하는 데 도움이 되는 제안입니다.
더 큰 인터네트워크의 일부라면 도메인과 이름 서버 설정을 중앙 기관과 조정합니다.
- 구조와 구성의 가능성이 아주 많으므로 계획을 굳히기 전에 TCP/IP, DNS, BIND를 익힙니다. 네트워크 정보 서비스를 쓰려면 NFS와 NIS도 익힙니다. 이 주제의 책은 널리 나와 있습니다. NIS와 NIS+에 관해서는 Network Information Services (NIS and NIS+) Guide를 봅니다.
- 미리 계획합니다. 이름을 바꾸는 것은 처음 정하는 것보다 훨씬 어렵습니다. 파일을 설정하기 전에 네트워크, 게이트웨이, 이름 서버, 호스트 이름에 대해 조직의 합의를 얻습니다.
- 이름 서버를 중복으로 둡니다. 중복 이름 서버를 둘 수 없으면 적어도 slave와 hint 이름 서버를 두어 어떤 형태로든 백업이 있게 합니다.
- 이름 서버를 고를 때는 다음을 생각합니다.
- 외부 시스템에 물리적으로 가장 가까운 기계를 고릅니다.
- 이름 서버는 될 수 있는 대로 서로 독립적이어야 합니다. 전원과 케이블을 따로 쓰도록 합니다.
- 이름 풀이 서비스를 백업할 다른 네트워크를 찾고, 다른 네트워크에도 같은 일을 해 줍니다.
- 서버를 시험합니다.
- 정방향과 역방향 이름 풀이를 모두 시험합니다.
- master에서 slave 이름 서버로의 영역 전송을 시험합니다.
- 시스템이 멈췄다 다시 부팅한 뒤 각 이름 서버를 시험합니다.
- 이름 풀이 요청이 외부 이름 서버로 가기 전에 forwarder 서버로 보냅니다. 그러면 이름 서버들이 캐시를 나눠 쓰고 master 이름 서버의 부하를 줄여 성능이 좋아집니다.
영어 원문
Planning for DOMAIN name resolution
These suggestions can help you plan your own DOMAIN name resolution system.
If you are part of a larger internetwork, coordinate setting up your domain and name servers with the central authority.
Because of the vast possibilities in architecture and configuration, become familiar with TCP/IP, DNS, and BIND before you solidify any plans. If you plan to use a network information service, become familiar with NFS and NIS as well. Books about these topics are widely available. For more information about NIS and NIS+, see Network Information Services (NIS and NIS+) Guide.
Plan ahead. Changing a name is much more difficult than setting up the initial one. Obtain consensus from your organization on network, gateway, name server, and host names before you set up your files.
Set up redundant name servers. If you cannot set up redundant name servers, be sure to set up slave and hint name servers so you have some type of backup.
In selecting the name servers, keep the following in mind: – Choose machines that are physically closest to exterior systems. – The name servers should be as independent as possible. Try for different power supplies and independent cabling. – Find another network to back up your name resolution service, and do the same for other networks.
Test the servers. – Test both regular and reverse name resolution. – Test zone transfer from master to slave name servers. – Test each name server after a system crash and reboot.
Send name resolution requests to forwarder servers before they go to exterior name servers. This allows your name servers to share caches and improve performance by reducing the load on your master name servers.
objectclass container
requires
objectclass,
cn
objectclass hosts
requires
objectclass,
hname
allows
addr
halias,
comment