Ubuntu – Dynamic IP with static DNS

dhcpdnsinterfaceip

Getting a dhcp'd IP ok, but DNS is not resolving.

2 part question:

  1. using nmcli how can I see what DNS server's I am using?
  2. where do I go to configure a STATIC DNS server for a wireless interface that is getting it's IP through DHCP? (/etc/network/interfaces..?)

note, I would prefer to do this via cli and not gui.

Thanks!

Luis

Best Answer

To answer part 2 of your question, you can edit /etc/network/interfaces, and add the following line:

dns-nameservers 8.8.8.8 4.2.2.2

So that your interfaces file looks something like this:

auto <interfacename>
iface <interfacename> inet dhcp
dns-nameservers 8.8.8.8 4.2.2.2

Make sure to replace < interfacename > with wlan0 or whatever your wifi interface is called.