문서 편집

우분투 DNS 바꾸기

확인

현재 설정을 다음의 명령으로 알아볼 수 있다.

$ sudo nslookup server 
Server:		12.34.56.78
Address:	12.34.56.78#53

** server can't find server: NXDOMAIN
$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 12.34.56.78

변경

먼저 네트워크 장비의 이름 확인

$ cat /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp0s25
iface enp0s25 inet static
    address 192.168.0.6
    netmask 255.255.255.0
    gateway 192.168.0.1
    dns-nameservers 168.126.63.1 168.126.63.2 8.8.8.8 8.8.4.4
    up ethtoo -s enp0s25 wol g

장비 이름이 enp0s25 이므로

 echo "nameserver 8.8.8.8" | sudo resolvconf -a enp0s25.inet

재확인

$ sudo nslookup server
Server:		8.8.8.8
Address:	8.8.8.8#53

** server can't find server: NXDOMAIN
$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8

연결문서

CC Attribution-Noncommercial-Share Alike 4.0 International 별도로 명시하지 않을 경우, 이 페이지의 내용은 다음 라이선스에 따라 사용할 수 있습니다: CC Attribution-Noncommercial-Share Alike 4.0 International
1.6 KB tech/우분투_dns_바꾸기.txt · 마지막으로 수정됨 2018/03/21 21:49 저자 V_L V_L
vln

0.021 seconds in processing this page on this powerful server.