6

ubuntu16.04 下设置静态IP,并且添加 dns 解析服务器

 3 years ago
source link: https://blog.popkx.com/ubuntu16-04-set-static-ip-and-add-dns-server/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

ubuntu16.04 下设置静态IP,并且添加 dns 解析服务器

发表于 2018-07-20 21:07:53   |   已被 访问: 419 次   |   分类于:   Linux笔记   |   暂无评论

首先执行 ifconfig 命令,结果如下

记住 ens33 这个名字。执行:

sudo vim /etc/network/interfaces

添加内容如下:

dns 服务器可以根据自己情况选择。

dns-nameserver 这句一定需要有,
因为以前是DHCP解析,所以会自动分配DNS 服务器地址。
而一旦设置为静态IP后就没有自动获取到DNS服务器了,需要自己设置一个
设置完重启电脑后,/etc/resolv.conf 文件中会自动添加 nameserver 101.226.4.6
(或者nameserver 8.8.8.8)可以根据访问速度,选择合适的公共DNS
`

阅读更多:   Linux笔记


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK