By looking at your comment you've said that you changed it to static via terminal. Assuming that; you've two ways where you can achieve which will be permanent even when you reboot the system.
- First is via terminal by adding an additional line to specify DNS
- Assigning manual IP's via GUI whilst setting the interface to default (reverting back network config)
Since you've used terminal, you may add below line to your /etc/network/interfaces
file. Add it to the end of the file
dns-nameservers 127.0.0.1 8.8.8.8
You don't need to add your gateway as a DNS. You may add above two DNS with a space between the two. Also, below seen is a sample configuration of an interface.
auto eth0 # add this to auto up on boot
iface eth0 inet static
address 192.x.x.x
netmask 255.255.255.0
gateway 192.x.x.x
dns-search example.com # This is for windows AD environment
dns-nameservers 127.0.0.1 8.8.8.8
As you can see, the attribute dns-search example.com
is for Windows Active directory environment. You can remove that line.
Once done. Please restart you network interface using below command.
sudo /etc/init.d/networking restart
and then view the resolv.conf
file with cat /etc/resolv.conf
which should show the DNS configuration. You may also reboot and have a look through.
Hope this helps! :)
network.config
but I certainly know that you will need to editresolv.conf
file to assign DNS. BTW, could you please tell me whether you've assigned a static IP by assigning manually or is it taking through DHCP?