반응형
참고:
테스트한 날: 2026년 2월 24일
테스트에 사용했던 OS: Ubuntu 24.04
Ubuntu 24.04에서 사람이 /etc/resolv.conf 파일을 직접 수정하면, OS에 의해서 /etc/resolv.conf 파일이 초기화된다.
그러므로 /etc/resolv.conf 파일을 직접 수정하면 안 된다.
대신 아래와 같이 내가 원하는 name server의 IP address를 설정하는 것이 좋다.
"DNS=" 항목에 원하는 IP address를 추가한다.
$ vi /etc/systemd/resolved.conf
... 중간 생략 ...
[Resolve]
DNS=1.1.1.1 8.8.8.8
... 중간 생략 ...
systemd-resolved 서비스를 재시작한다.
$ sudo systemctl restart systemd-resolved
잘 설정되었는지 아래와 같이 확인한다.
$ resolvectl status
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
Current DNS Server: 1.1.1.1
DNS Servers: 1.1.1.1 8.8.8.8
... 중간 생략 ...
$ nslookup example.com
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: example.com
Address: 104.18.27.120
Name: example.com
Address: 104.18.26.120
... 중간 생략 ...
'Ubuntu' 카테고리의 다른 글
| iptables and netfilter (1) | 2021.07.10 |
|---|---|
| tcpdump로 HTTP Packet Decode 하기 및 tshark 사용법 (0) | 2021.07.10 |
| sudoers 설정 (암호 입력 없이 root 사용자 권한 얻기) (0) | 2021.07.10 |
| Configure DNAT(Port Forward) for KVM (to connect into VM from outer network) (0) | 2021.07.10 |
| Desktop Sharing (원격 데스크탑, Remote Desktop) on Ubuntu 24.04 (0) | 2021.07.10 |