Set up Static IP and Static DNS on Ubutunu 14.04
Many people seem to jump through a lot of hoops to figure this out, but according to the instructions on Ubuntu’s site, you update the following:
sudo nano /etc/network/interfaces
This is the default file:
# This file...
# and how to activate...
# The loopback...
iface lo inet loopback
# The primary network interface
iface eth0 inet dhcp
This is the updated file below “# The primary network interface”. Replace x’s with your IPs, of course. Also, Google’s DNS servers shown as example.
#iface eth0 inet dhcp
iface eth0 inet static
# you may not need dns-search
# I use it because I'm running this on a Windows network
# so its useful to have
# dns-search x.y
dns-nameservers 126.96.36.199 188.8.131.52
Works every time for me. That said, I don’t know why there are so many other ways people do this and that makes me think I’m missing something. Let me know below if you agree/disagree.