2016年6月1日 星期三

手動設定Ubuntu的nameserver(dns)、固定IP

To set remote dns server manually, we have to modify the file, "/etc/network/interface" .

To set 8.8.8.8 as our name server, add "dns-nameservers 8.8.8.8" to the file.

And to set the static IP, modify the file "/etc/network/interface" as well.
# The primary network interface
auto ens33
iface ens33 inet dhcp
change dhcp to static, and add information you need.

e.g.
# The primary network interface
auto ens33
iface ens33 inet static
address 192.168.20.103
netmask 255.255.255.0
gateway 192.168.20.1

Then "sudo systemctl restart networking.service" or "sudo /etc/init.d/networking restart" to make the modification effective.

沒有留言:

張貼留言