19.3.3. Example Zone File


Seen individually, directives and resource records can be difficult to grasp. However, when placed together in a single file, they become easier to understand.
The following example shows a very basic zone file.
$ORIGIN example.com.
$TTL 86400
@		IN	SOA	dns1.example.com.	hostmaster.example.com. (
			2001062501 ; serial
			21600      ; refresh after 6 hours
			3600       ; retry after 1 hour
			604800     ; expire after 1 week
			86400 )    ; minimum TTL of 1 day
;
;
		IN	NS	dns1.example.com.
		IN	NS	dns2.example.com.
dns1		IN	A	10.0.1.1
		IN	AAAA	aaaa:bbbb::1
dns2		IN	A	10.0.1.2
		IN	AAAA	aaaa:bbbb::2
;
;
@		IN	MX	10	mail.example.com.
		IN	MX	20	mail2.example.com.
mail		IN	A	10.0.1.5
		IN	AAAA	aaaa:bbbb::5
mail2		IN	A	10.0.1.6
		IN	AAAA	aaaa:bbbb::6
;
;
; This sample zone file illustrates sharing the same IP addresses
; for multiple services:
;
services	IN	A	10.0.1.10
		IN	AAAA	aaaa:bbbb::10
		IN	A	10.0.1.11
		IN	AAAA	aaaa:bbbb::11
ftp		IN	CNAME	services.example.com.
www		IN	CNAME	services.example.com.
;
;
In this example, standard directives and SOA values are used. The authoritative nameservers are set as dns1.example.com and dns2.example.com, which have A records that tie them to 10.0.1.1 and 10.0.1.2, respectively.
The email servers configured with the MX records point to mail and mail2 via A records. Since the mail and mail2 names do not end in a trailing period (.), the $ORIGIN domain is placed after them, expanding them to mail.example.com and mail2.example.com. Through the related A resource records, their IP addresses can be determined.
Services available at the standard names, such as www.example.com (WWW), are pointed at the appropriate servers using a CNAME record.
This zone file would be called into service with a zone statement in the named.conf similar to the following:
zone "example.com" IN {
	type master;
	file "example.com.zone";
	allow-update { none; };
};
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.