DNS 영역은 무엇입니까?
DNS 영역은 특정 조직 또는 관리자에 의해 관리되는 DNS 네임스페이스의 명백한 부분입니다. 영역은 하나 이상의 도메인에 대한 DNS 레코드를 포함하고 저자명서에 의해 제공됩니다. 도메인은 DNS 트리의 이름이지만, 영역은 네임 서버가 쿼리에 책임있는 관리 경계 정의입니다.
도메인 대 영역
구별을 이해하는 것은 중요합니다:
도메인
도메인은 DNS hierarchy의 이름입니다.
example.com (domain)
└── www.example.com (subdomain)
└── blog.example.com (subdomain)
└── api.example.com (subdomain)
지역
지역은 기록에 관리 통제입니다:
도메인 및 하위 도메인의 단일 영역 :example.com zone contains:
- example.com
- www.example.com
- blog.example.com
- api.example.com
Managed by: ns1.example.com, ns2.example.com
Delegated Subdomain Zone:
example.com zone contains:
- example.com
- www.example.com
- Delegation: api.example.com → different nameservers
api.example.com zone (separate) contains:
- api.example.com
- v1.api.example.com
- v2.api.example.com
Managed by: ns1.apihost.com, ns2.apihost.com
영역 구성
Zone 파일
영역의 모든 DNS 레코드를 포함하는 텍스트 파일:
; example.com zone file
$TTL 3600
@ IN SOA ns1.example.com. admin.example.com. (
2024010101 ; Serial
7200 ; Refresh
3600 ; Retry
1209600 ; Expire
3600 ; Minimum TTL
)
; Nameserver records
@ IN NS ns1.example.com.
@ IN NS ns2.example.com.
; A records
@ IN A 203.0.113.50
www IN A 203.0.113.50
blog IN A 203.0.113.51
; MX records
@ IN MX 10 mail.example.com.
mail IN A 203.0.113.52
; CNAME records
ftp IN CNAME www.example.com.
; TXT records
@ IN TXT "v=spf1 include:_spf.google.com ~all"
SOA 기록 ( 권위의 시작)
각 지역은 정확하게 1개의 SOA 기록이 있어야 합니다:
example.com. IN SOA ns1.example.com. admin.example.com. (
2024010101 ; Serial
7200 ; Refresh
3600 ; Retry
1209600 ; Expire
3600 ; Minimum TTL
)
SOA 필드 :
| 제품정보 | 제품정보 | 예제 값 |
|---|---|---|
| 기본 NS | 마스터 네임서버 | ns1.example.com |
| 비밀번호 | 연락처 (@ → .) | admin.example.com (admin@example.com) 테크밸리 주식회사 |
| (주) | 지역 버전 번호 | 2024010101년 |
| 지원하다 | 두 번째 NS 체크 간격 | 7200s (2 시간) |
| 관련 기사 | 새로 고침이 실패한 경우 복원 간격 | 3600s (1 시간) |
| 패스워드 | 두 번째 NS는 후에 포기합니다 | 1209600s (14 일) |
| 최소 TTL | 부정 캐싱 기간 | 3600s (1 시간) |
NS 레코드 (Nameservers)
해당 서버에 대한 권한은 다음과 같습니다.
example.com. IN NS ns1.example.com.
example.com. IN NS ns2.example.com.
이 영역의 레코드를 쿼리하는 세계를 말합니다.
지역 유형
1차 구역(Master)
Zone 레코드가 편집 된 저자 소스 :
ns1.example.com (primary)
→ Zone file edited here
→ Changes made directly
→ Notifies secondaries of updates
두 번째 영역 (Slave)
1 차에서 복제하는 읽기 전용 사본:
ns2.example.com (secondary)
→ Retrieves zone data from primary
→ Cannot be edited directly
→ Automatically syncs based on SOA refresh interval
지역 이동 (AXFR) :
1. Secondary checks SOA serial number
2. If primary serial is higher → request full zone transfer
3. Primary sends entire zone
4. Secondary updates its copy
Incremental Transfer (IXFR) :
1. Secondary requests only changes since last serial
2. Primary sends diff
3. More efficient for large zones with small changes
앞으로 지역
IP 주소로 도메인 이름 (대부분):
example.com → 203.0.113.50
www.example.com → 203.0.113.50
반전 지역
지도 IP 주소 도메인 이름 (PTR 레코드):
50.113.0.203.in-addr.arpa → example.com
사용 :
- 이메일 서버 검증
- 로깅 및 보안
- 문제 해결
지역 위임
위임은 하위 도메인에 대한 별도의 영역을 만듭니다.
부모 영역 (example.com)
; example.com zone
@ IN A 203.0.113.50
www IN A 203.0.113.50
; Delegate api.example.com to different nameservers
api IN NS ns1.apihost.com.
api IN NS ns2.apihost.com.
; Glue records (if needed)
ns1.api IN A 198.51.100.1
ns2.api IN A 198.51.100.2
위임 영역 (api.example.com)
다른 nameservers에 완전히 별도의 영역 파일:
; api.example.com zone (on ns1.apihost.com)
@ IN A 198.51.100.10
v1 IN A 198.51.100.11
v2 IN A 198.51.100.12
왜 Delegate?
- 조직: 다른 팀은 다른 지역을 관리합니다
- Performance: DNS 부하 분산
- Security: 민감한 서비스
지역 관리
일련 번호 관리
일련 번호 궤도 지역 버전 (일반적으로 YYYYMMDDnn 체재):
2024010101 ; January 1, 2024, version 01
2024010102 ; January 1, 2024, version 02
2024010201 ; January 2, 2024, version 01
문헌 : 직렬는 각 변화로 증가해야 합니다, 또는 두번째는 갱신하지 않을 것입니다.
Zone Transfer 보안
Problem: 영역 전송은 모든 DNS 레코드를 노출 Solution : 지역은 승인 된 두 번째로 이동 BIND 구성:zone "example.com" {
type master;
file "/var/named/example.com.zone";
allow-transfer { 203.0.113.52; 203.0.113.53; }; // Secondary IPs only
notify yes;
};
TSIG (Transaction Signature) : Authenticate 영역은 공유 키로 이동:
key "transfer-key" {
algorithm hmac-sha256;
secret "base64-encoded-key";
};
allow-transfer { key transfer-key; };
Zone 구성 보기
Query SOA 기록
dig example.com SOA
; ANSWER SECTION:
example.com. 3600 IN SOA ns1.example.com. admin.example.com. (
2024010101 7200 3600 1209600 3600 )
Query NS 기록
dig example.com NS
; ANSWER SECTION:
example.com. 86400 IN NS ns1.example.com.
example.com. 86400 IN NS ns2.example.com.
지역 전송 (AXFR)
dig @ns1.example.com example.com AXFR
# If allowed, returns entire zone
# If denied, returns transfer failed
대부분의 public nameservers deny AXFR은 정보 공개를 방지합니다.
일반적인 Zone 구성
웹사이트
example.com zone:
@ A 203.0.113.50
www A 203.0.113.50
@ MX 10 mail.example.com
mail A 203.0.113.51
@ TXT "v=spf1 mx -all"
멀티 서비스 영역
example.com zone:
@ A 203.0.113.50
www A 203.0.113.50
blog CNAME hosting.wordpress.com.
shop CNAME shops.myshopify.com.
cdn CNAME d111111abcdef8.cloudfront.net.
@ MX 10 aspmx.l.google.com.
위임된 하위 도메인
example.com zone:
@ A 203.0.113.50
www A 203.0.113.50
; Delegate api to AWS Route 53
api NS ns-123.awsdns-01.com.
api NS ns-456.awsdns-02.net.
; Delegate cdn to Cloudflare
cdn NS ns1.cloudflare.com.
cdn NS ns2.cloudflare.com.
Zone 파일 모범 사례
1. Always increment serial : 각 변경 후, 또는 두 번째는 업데이트되지 않습니다.
2. 날짜 기반 serials 사용 : clarity를 위한 체재 YYYYMMDDnn
3. 지역 이동 제한 : 공인된 두 번째로만 허용
4. 여러 네임서버 사용 : 적어도 2, 다른 네트워크에서 선호
5. 적절한 TTL 설정 : 밸런스 캐싱 혜택 vs 업데이트 속도
6. 적용하기 전에 테스트: 적재하기 전에 유효 영역 파일 구문
7. Monitor 영역 이동 : 두 번째는 동기화
8. 문항 : 영역이 위임되고있는 메모
9. 백업 영역 파일 : 일반 백업은 데이터 손실 방지
10. 버전 컨트롤 사용 : 시간대 파일 변경
고급 영역 기능
DNSSEC (Zone 서명)
Cryptographically 표시 영역 기록:
example.com. IN A 203.0.113.50
example.com. IN RRSIG A 8 2 3600 (
signature-data-here )
캐시 중독과 탬퍼링에 대한 보호.
동적 DNS (DDNS)
programmatic 영역 업데이트 허용:
# Update A record dynamically
nsupdate -k Kupdate.key <<EOF
server ns1.example.com
update delete www.example.com A
update add www.example.com 300 A 203.0.113.51
send
EOF
유용한 정보:
- 홈 IP 주소 업데이트
- Auto-scaling 인프라
- 서비스 발견
지역 보기 (Split Horizon DNS)
클라이언트 IP에 근거를 둔 다른 지역 자료:
Internal clients: example.com → 10.0.0.50 (internal)
External clients: example.com → 203.0.113.50 (public)
사용 사례:
- 내부 대 외부 웹 사이트 버전
- 개인 네트워크 리소스
- Geo 기반 응답
문제 해결 영역 문제
지역 전송 실패
Symptom: 동기화 중 두 번째 체크 :# Check if primary allows transfers
dig @ns1.example.com example.com AXFR
# Check secondary logs for errors
tail -f /var/log/named.log
소설 :
- 허용 전송 설정 검증
- 서버간에 네트워크 연결 확인
- 일련 번호 증가
일련 번호 Incrementing
Symptom: 두 번째로 전파하지 않기 Solution : 항상 각 영역 편집을 가진 serial 증가위임 작업
Symptom : Subdomain은 해결하지 않습니다 체크 :# Verify delegation
dig example.com NS
dig api.example.com NS
# Should show different nameservers for delegated subdomain
소설 **:
- 부모 영역에서 NS 레코드 검증
- Nameservers가 subdomain 안에 있는 경우에 접착제 기록을 검사하십시오
- 자녀 영역 확인
DNS 영역은 분산 된 DNS 관리 기반입니다. 지역 구조, 위임 및 관리는 모든 크기의 조직을 위해 DNS를 효과적으로 구축 할 수 있습니다.