Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
355 views
in Technique[技术] by (71.8m points)

networking - How to set DNS server for device via nmcli?

I have tried to set up DNS according to https://askubuntu.com/questions/980382/how-do-i-to-set-the-dns-server-for-a-device-using-nmcli:

$ nmcli device show enxd03745d21988
GENERAL.DEVICE:                         enxd03745d21988
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         D0:37:45:D2:19:88
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     test
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnecti>
WIRED-PROPERTIES.CARRIER:               on
IP4.ADDRESS[1]:                         192.168.1.30/24
IP4.GATEWAY:                            192.168.1.1
IP4.ROUTE[1]:                           dst = 192.168.1.0/24, nh = 0.0.0.0, mt = 100
IP4.ROUTE[2]:                           dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 1000
IP4.ROUTE[3]:                           dst = 0.0.0.0/0, nh = 192.168.1.1, mt = 20100
IP4.DNS[1]:                             192.168.1.1
IP4.DNS[2]:                             8.8.8.8
IP4.DNS[3]:                             8.8.4.4
IP6.ADDRESS[1]:                         fe80::522f:f302:2a31:b3bd/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 100
IP6.ROUTE[2]:                           dst = ff00::/8, nh = ::, mt = 256, table=255

So I have dns set to 192.168.1.1,8.8.8.8,8.8.4.4 and my /etc/resolv.conf:

cat /etc/resolv.conf 

nameserver 127.0.0.53
options edns0 trust-ad
search Home

But still after pinging google.com:

ping google.com
ping: google.com: Temporary failure in name resolution

What should I do next?

uname -a:

Linux 5.8.0-40-generic #45-Ubuntu SMP Fri Jan 15 11:05:36 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
question from:https://stackoverflow.com/questions/65937557/how-to-set-dns-server-for-device-via-nmcli

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...