If you have the opportunity to build your own Ubuntu server in your local area network, it will inevitably involve modifying its ip address and changing the ip address to facilitate future access. Next, let's talk about how to set such an ip address. 1. Open/etc/network/interfaces2. comment out ifaceeth0inetdhcp3. Add. Please note that modify ifaceeth0inetstaticaddress192.16 according to your actual situation.
If you have the opportunity to build your own Ubuntu server in your local area network, it will inevitably involve modifying its ip address and changing the ip address to facilitate future access.
The following describes how to set such an ip address,
1. Open/etc/network/interfaces
2. Comment out iface eth0 inet dhcp
3. Add, please note, according to your actual situation to modify
Iface eth0 inet static
Address 192.168.1.201
Netmask 255.255.255.0
Gateway 192.168.1.1
4. Restart eth0 instead of adding sudo to the root account.
Ifconfig eth0 down
Ifconfig eth0 up
5. Restart the NIC
/Etc/init. d/networking restart
Now the network configuration is complete. However, in subsequent use, the dns server may not be found,
So how do I set up a static dns server?
If you modify/etc/resolv. conf, the modification will expire after the machine is restarted and will be overwritten by the default configuration.
A persistent approach is,
1. Add the/etc/resolvconf/resolv. conf. d/tail file.
2. Add nameserver. I recommend two, 8.8.8.8 8.4.43. restart dns resolution,/etc/init. d/resolvconf restart