Ubuntu 17.04 Server DNS Configuration [duplicate]

На этот вопрос уже есть ответ здесь:

Где изменить DNS, чтобы он не перезаписывался после перезагрузки?

# 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
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 103.241.42.2
nameserver 127.0.0.53
search xx

Я не знаю почему, но оба dns сервера выше отстой...

# dig google.com @103.241.42.2; dig google.com @127.0.0.53; dig google.com @8.8.8.8

; <<>> DiG 9.10.3-P4-Ubuntu <<>> google.com @103.241.42.2
;; global options: +cmd
;; connection timed out; no servers could be reached

; <<>> DiG 9.10.3-P4-Ubuntu <<>> google.com @127.0.0.53
;; global options: +cmd
;; connection timed out; no servers could be reached

; <<>> DiG 9.10.3-P4-Ubuntu <<>> google.com @8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40430
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             299     IN      A       172.217.26.78

;; Query time: 15 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Jun 16 16:17:59 WIB 2017
;; MSG SIZE  rcvd: 55
0
задан 16 June 2017 в 02:18

1 ответ

Принятие статического IP Вы добавляете его в /etc/network/interfaces

auto <interface>
iface <interface> inet static
    address <yourIP>
    network <yourNetmask>
    gateway <yourGateway>
    dns-nameservers 103.241.42.2 127.0.0.53
1
ответ дан 3 November 2019 в 02:06

Другие вопросы по тегам:

Похожие вопросы: