DNS: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
(Add categories: Network, Reference)
(Phase 6.1: LLM-Optimized Wiki Template 적용)
Line 1: Line 1:
A DNS server allows the client to resolve Internet host names without manually configuring DNS addresses.
{{Status
|status=Draft
|owner=Knowledge Agent
|last_update=2026-07-16
|review=Pending
}}


[https://computingforgeeks.com/bind-vs-dnsmasq-vs-powerdns-vs-unbound/ This page] describes popular open source DNS server with highlighted features
{{TOC}}
 
== Overview ==
 
DNS(Domain Name System) 서버는 클라이언트가 인터넷 호스트 이름을 수동으로 DNS 주소를 구성하지 않고도 해결할 수 있도록 합니다.
 
=== Summary ===
 
* 무엇인가? 도메인 이름을 IP 주소로 변환하는 시스템
* 왜 필요한가? 사람이 기억하기 쉬운 도메인 이름으로 인터넷 자원 접근
* 언제 사용하는가? 웹 서핑, 이메일, API 호출 등 모든 네트워크 연결
 
---
 
== Purpose ==
 
이 문서가 존재하는 이유
 
* Goal: DNS 기본 개념, systemd-resolved 설정, DNS 용어 설명 제공
* Scope: DNS 서버 설정, systemd-resolved 재설정, DNS 용어
* Non-goals: DNS 프로토콜 상세, BIND/PDNS 설정 가이드
 
---
 
== Key Concepts ==
 
{| class="wikitable"
! Concept
! Description
! Related
|-
| DNS
| Domain Name System — 도메인 이름을 IP 주소로 변환
| [[Network]]
|-
| Authoritative Name Server
| 공개 서버의 주소를 게시하는 DNS 서버
| [[DNS]]
|-
| DNS Cache
| 방문한 사이트 주소의 로컬 복사본
| [[DNS]]
|-
| Recursive Name Server
| 방문하려는 사이트 주소를 조회하는 DNS 서버
| [[DNS]]
|-
| systemd-resolved
| [[Linux]] 시스템 DNS 관리 데몬
| [[systemd]]
|-
| resolvectl
| systemd-resolved 상태 확인/설정 도구
| [[systemd-resolved]]
|}
 
---
 
== Architecture ==
 
DNS 조회 프로세스:
 
<syntaxhighlight lang="mermaid">
graph TD
    A[클라이언트 요청] --> B[DNS Cache 확인]
    B -->|캐시 있음| C[캐시에서 응답]
    B -->|캐시 없음| D[Recursive Name Server]
    D --> E[Root DNS]
    E --> F[TLD DNS]
    F --> G[Authoritative DNS]
    G --> H[IP 주소 반환]
    H --> D
    D --> C
    C --> I[클라이언트 응답]
</syntaxhighlight>
 
---
 
== Workflow ==
 
=== systemd-resolved 재설정 ===
 
# /etc/systemd/resolved.conf 업데이트
# [Resolve]
# DNS=192.168.1.1 8.8.8.8
# FallbackDNS=8.8.4.4
 
# systemd-resolved 재시작
# service systemd-resolved restart
 
# 상태 확인
# systemd-resolve --status
# 또는
# resolvectl status
 
# 심볼릭 링크 확인
# /etc/resolv.conf -> /run/systemd/resolve/resolv.conf
 
---
 
== Detailed Explanation ==
 
=== DNS 기본 개념 ===
 
DNS 서버는 클라이언트가 인터넷 호스트 이름을 수동으로 DNS 주소를 구성하지 않고도 해결할 수 있도록 합니다.
 
=== DNS 용어 ===
 
* '''Authoritative name server''' — 공개 서버의 주소를 게시하는 DNS 서버. 웹, 메일, FTP 서버 등 인터넷에 노출된 서버의 IP 주소와 이름을 매핑합니다. 이는 조직 내 DNS 서버일 수도 있고, ISP 또는 호스팅 서비스에서 관리할 수도 있습니다. 공개 서버에서 <code>dig</code> 명령어로 이름과 IP 주소 매핑을 확인할 수 있습니다:


== Reset systemd-resolved ==
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
1. Update /etc/systemd/resolved.conf
$ dig +nocmd www.linux.com +noall +answer
www.linux.com.  5276 IN  A  140.211.169.7
</syntaxhighlight>
 
* '''DNS cache''' — 방문한 사이트 주소의 로컬 복사본. 네트워크 성능을 향상시킵니다. 네트워크 애플리케이션이 원격 서버의 DNS 쿼리에 대기할 필요가 없기 때문입니다.
 
* '''Recursive name server''' — 방문하려는 사이트 주소를 조회하는 DNS 서버. 재귀 및 캐시 기능은 종종 동일한 서버에서 결합됩니다. Google Public DNS와 OpenDNS는 재귀 및 캐싱 서버입니다.
 
=== systemd-resolved 재설정 ===
 
<syntaxhighlight lang="bash">
1. /etc/systemd/resolved.conf 업데이트
     [Resolve]
     [Resolve]
     DNS=192.168.1.1 8.8.8.8
     DNS=192.168.1.1 8.8.8.8
     FallbackDNS=8.8.4.4
     FallbackDNS=8.8.4.4


2. Restart system resolved: service systemd-resolved restart
2. systemd-resolved 재시작: service systemd-resolved restart


3. Run systemd-resolve --status (or resolvectl status in newer versions of systemd). The output should look like this:
3. systemd-resolve --status 실행 (또는 newer systemd 버전에서 resolvectl status)
     Global
     Global
             DNS Servers: 1.1.1.1
             DNS Servers: 1.1.1.1
                           8.8.8.8
                           8.8.8.8
     ...
     ...
4. Run resolvectl dns
Global: 8.8.8.8
...
Link 2 (interface): 192.168.1.1 8.8.8.8 8.8.4.4


** Make sure right symbolic link /etc/resolv.conf -> /run/systemd/resolve/resolv.conf
4. resolvectl dns 실행
5. sudo rm -f /etc/resolv.conf && sudo ln -sv /run/systemd/resolve/resolv.conf /etc/resolv.conf
    Global: 8.8.8.8
    ...
    Link 2 (interface): 192.168.1.1 8.8.8.8 8.8.4.4


5. /etc/resolv.conf 심볼릭 링크 확인: /run/systemd/resolve/resolv.conf
    sudo rm -f /etc/resolv.conf && sudo ln -sv /run/systemd/resolve/resolv.conf /etc/resolv.conf
</syntaxhighlight>
</syntaxhighlight>


== Teminology in DNS ==
---


*   An ''authoritative'' name server is for publishing the addresses of public servers. If you have an internet-facing server such as a Web, mail or FTP server, then somewhere there is an authoritative server that advertises their IP addresses and names. This may be an authoritative DNS (domain name services) server on your premises, or managed by a third party like your Internet service provider or a hosting service. You can query any public server with the <code>dig</code> command to see how its name and IP address are matched up:
== Configuration ==


$ dig +nocmd www.linux.com +noall +answer
=== /etc/systemd/resolved.conf ===
www.linux.com.  5276 IN  A  140.211.169.7 


* A ''dns cache'' is a local copy of the addresses of sites you have visited. This speeds up your network performance because network applications don’t have to wait for DNS queries to be answered by remote servers
<syntaxhighlight lang="text">
* A ''recursive'' name server is the one that looks up the address of sites you want to visit. Recursive and cache functions are often combined in the same server, Google Public DNS and OpenDNS are recursive and caching servers.
[Resolve]
DNS=192.168.1.1 8.8.8.8
FallbackDNS=8.8.4.4
</syntaxhighlight>
 
---
 
== Examples ==
 
=== Example 1: DNS 상태 확인 ===
 
입력:
 
<syntaxhighlight lang="bash">
$ resolvectl status
</syntaxhighlight>
 
출력:
 
<syntaxhighlight lang="bash">
Global
        DNS Servers: 1.1.1.1
                      8.8.8.8
 
Link 2 (eth0)
      Current Scopes: DNS
DefaultRoute setting: yes
      DNS Servers: 192.168.1.1
                    8.8.8.8
                    8.8.4.4
</syntaxhighlight>
 
=== Example 2: DNS 쿼리 ===
 
입력:
 
<syntaxhighlight lang="bash">
$ dig +nocmd www.linux.com +noall +answer
</syntaxhighlight>
 
출력:
 
<syntaxhighlight lang="bash">
www.linux.com.  5276 IN  A  140.211.169.7
</syntaxhighlight>
 
---
 
== Best Practices ==
 
* '''여러 DNS 서버 구성''' — 주요 DNS + Fallback DNS 설정
* '''systemd-resolved 사용''' — 최신 Linux 배포판 기본 DNS 관리
* '''심볼릭 링크 확인''' — /etc/resolv.conf가 systemd-resolved로 연결되어 있는지 확인
* '''캐시 활성화''' — DNS 캐시로 네트워크 성능 향상
 
---
 
== Limitations ==
 
* DNS 캐시 없음 — 모든 쿼리가 원격 서버로 전송되어 지연 시간 증가
* 단일 DNS 서버 — 해당 서버 장애 시 전체 DNS 해결 실패
* resolvectl 미지원 — 구형 systemd 버전에서는 systemd-resolve --status 사용
 
---


== References ==
== References ==
<references />
 
* https://computingforgeeks.com/bind-vs-dnsmasq-vs-powerdns-vs-unbound/
 
---
 
== Related Pages ==
 
* [[DHCP]]
* [[Network]]
* [[systemd]]
* [[resolvectl]]
* [[systemd-resolved]]
 
---


[[Category:Network]]
[[Category:Network]]
[[Category:Reference]]
[[Category:Reference]]

Revision as of 14:28, 16 July 2026

Template:Status

Template:TOC

Overview

DNS(Domain Name System) 서버는 클라이언트가 인터넷 호스트 이름을 수동으로 DNS 주소를 구성하지 않고도 해결할 수 있도록 합니다.

Summary

  • 무엇인가? 도메인 이름을 IP 주소로 변환하는 시스템
  • 왜 필요한가? 사람이 기억하기 쉬운 도메인 이름으로 인터넷 자원 접근
  • 언제 사용하는가? 웹 서핑, 이메일, API 호출 등 모든 네트워크 연결

---

Purpose

이 문서가 존재하는 이유

  • Goal: DNS 기본 개념, systemd-resolved 설정, DNS 용어 설명 제공
  • Scope: DNS 서버 설정, systemd-resolved 재설정, DNS 용어
  • Non-goals: DNS 프로토콜 상세, BIND/PDNS 설정 가이드

---

Key Concepts

Concept Description Related
DNS Domain Name System — 도메인 이름을 IP 주소로 변환 Network
Authoritative Name Server 공개 서버의 주소를 게시하는 DNS 서버 DNS
DNS Cache 방문한 사이트 주소의 로컬 복사본 DNS
Recursive Name Server 방문하려는 사이트 주소를 조회하는 DNS 서버 DNS
systemd-resolved Linux 시스템 DNS 관리 데몬 systemd
resolvectl systemd-resolved 상태 확인/설정 도구 systemd-resolved

---

Architecture

DNS 조회 프로세스:

graph TD
    A[클라이언트 요청] --> B[DNS Cache 확인]
    B -->|캐시 있음| C[캐시에서 응답]
    B -->|캐시 없음| D[Recursive Name Server]
    D --> E[Root DNS]
    E --> F[TLD DNS]
    F --> G[Authoritative DNS]
    G --> H[IP 주소 반환]
    H --> D
    D --> C
    C --> I[클라이언트 응답]

---

Workflow

systemd-resolved 재설정

  1. /etc/systemd/resolved.conf 업데이트
  2. [Resolve]
  3. DNS=192.168.1.1 8.8.8.8
  4. FallbackDNS=8.8.4.4
  1. systemd-resolved 재시작
  2. service systemd-resolved restart
  1. 상태 확인
  2. systemd-resolve --status
  3. 또는
  4. resolvectl status
  1. 심볼릭 링크 확인
  2. /etc/resolv.conf -> /run/systemd/resolve/resolv.conf

---

Detailed Explanation

DNS 기본 개념

DNS 서버는 클라이언트가 인터넷 호스트 이름을 수동으로 DNS 주소를 구성하지 않고도 해결할 수 있도록 합니다.

DNS 용어

  • Authoritative name server — 공개 서버의 주소를 게시하는 DNS 서버. 웹, 메일, FTP 서버 등 인터넷에 노출된 서버의 IP 주소와 이름을 매핑합니다. 이는 조직 내 DNS 서버일 수도 있고, ISP 또는 호스팅 서비스에서 관리할 수도 있습니다. 공개 서버에서 dig 명령어로 이름과 IP 주소 매핑을 확인할 수 있습니다:
$ dig +nocmd www.linux.com +noall +answer
www.linux.com.  5276 IN  A  140.211.169.7
  • DNS cache — 방문한 사이트 주소의 로컬 복사본. 네트워크 성능을 향상시킵니다. 네트워크 애플리케이션이 원격 서버의 DNS 쿼리에 대기할 필요가 없기 때문입니다.
  • Recursive name server — 방문하려는 사이트 주소를 조회하는 DNS 서버. 재귀 및 캐시 기능은 종종 동일한 서버에서 결합됩니다. Google Public DNS와 OpenDNS는 재귀 및 캐싱 서버입니다.

systemd-resolved 재설정

1. /etc/systemd/resolved.conf 업데이트
    [Resolve]
    DNS=192.168.1.1 8.8.8.8
    FallbackDNS=8.8.4.4

2. systemd-resolved 재시작: service systemd-resolved restart

3. systemd-resolve --status 실행 (또는 newer systemd 버전에서 resolvectl status)
    Global
             DNS Servers: 1.1.1.1
                          8.8.8.8
    ...

4. resolvectl dns 실행
    Global: 8.8.8.8
    ...
    Link 2 (interface): 192.168.1.1 8.8.8.8 8.8.4.4

5. /etc/resolv.conf 심볼릭 링크 확인: /run/systemd/resolve/resolv.conf
    sudo rm -f /etc/resolv.conf && sudo ln -sv /run/systemd/resolve/resolv.conf /etc/resolv.conf

---

Configuration

/etc/systemd/resolved.conf

[Resolve]
DNS=192.168.1.1 8.8.8.8
FallbackDNS=8.8.4.4

---

Examples

Example 1: DNS 상태 확인

입력:

$ resolvectl status

출력:

Global
         DNS Servers: 1.1.1.1
                      8.8.8.8

Link 2 (eth0)
      Current Scopes: DNS
DefaultRoute setting: yes
       DNS Servers: 192.168.1.1
                    8.8.8.8
                    8.8.4.4

Example 2: DNS 쿼리

입력:

$ dig +nocmd www.linux.com +noall +answer

출력:

www.linux.com.  5276 IN  A  140.211.169.7

---

Best Practices

  • 여러 DNS 서버 구성 — 주요 DNS + Fallback DNS 설정
  • systemd-resolved 사용 — 최신 Linux 배포판 기본 DNS 관리
  • 심볼릭 링크 확인 — /etc/resolv.conf가 systemd-resolved로 연결되어 있는지 확인
  • 캐시 활성화 — DNS 캐시로 네트워크 성능 향상

---

Limitations

  • DNS 캐시 없음 — 모든 쿼리가 원격 서버로 전송되어 지연 시간 증가
  • 단일 DNS 서버 — 해당 서버 장애 시 전체 DNS 해결 실패
  • resolvectl 미지원 — 구형 systemd 버전에서는 systemd-resolve --status 사용

---

References

---

Related Pages

---