zeze

1、查看dns:

cat /etc/resolv.conf

2、Ubuntu固定ip

sudo vim /etc/network/interfaces

修改如下部分:

auto p3p1 
iface p3p1 inet static
address 59.77.132.80

netmask 255.255.255.0 #子网掩码

gateway 59.77.132.127 #网关

 

2. 修改dns解析

因为以前是dhcp解析,所以会自动分配dns服务器地址

而一旦设置为静态ip后就没有自动获取到的dns服务器了

要自己设置一个

sudo vim /etc/resolv.conf

写上一个公网的DNS:

nameserver 218.85.157.99
nameserver 210.34.48.34
nameserver 58.22.96.66
search func.fzu.edu.cn

如果重启的话,/etc/resolv.conf还是会变为原来的样子,所以要让其永久改变,因此,执行:

sudo vim /etc/resolvconf/resolv.conf.d/base

3. 重启网卡或者重启:

sudo /etc/init.d/networking restart

分类:

技术点:

相关文章:

  • 2021-09-17
  • 2021-11-19
  • 2021-05-22
  • 2021-06-14
  • 2021-12-11
  • 2021-05-20
猜你喜欢
  • 2021-12-16
  • 2021-11-10
  • 2021-12-09
  • 2022-12-23
  • 2021-05-07
  • 2022-02-17
  • 2022-02-02
相关资源
相似解决方案