For several months, I have been successfully connected to the net via a static IP with my machine that is running ubuntu (16.04.3). I recently had to reinstall the OS, and now on the same machine, the system is ignoring my DNS settings. The DNS server hasn't changed, nor has the machine's static IP address changed. Furthermore, I can ping the DNS IP addresses with no problem from the ubuntu device. As a double check, other machines that I own and which reside on the same network have no trouble with DNS using the same addresses.
For the purpose of this discussion, assume the following hypothetical settings:
Hostname: host-o-rama-bama.com
Static IP: 10.20.30.40
Gateway: 10.20.30.1
Netmask: 255.255.255.0
DNS server: 100.110.120.130
DNS server: 100.110.120.140
Using the Ubuntu Network Manager, I configured these settings as follows:
General
* Automatically connect to this network when it is available: Yes
* All users may connect to this network: Yes
Ethernet
* Device: enp2s0f1
* Wake on LAN: Default
802.1x security
(None)
DCB
(None)
IPV4 Settings
* Method: Manual
* Address: 10.20.30.40
* Netmask: 255.255.255.0
* Gateway: 10.20.30.1
* DNS Servers: 100.110.120.130,100.110.120.140
* Search Domains: host-o-rama-bama.com
IPV6 Settings
* Method: Ignore
After starting the network ...
# ifconfig
enp2s0f1 Link encap:Ethernet HWaddr 80:fa:5b:4c:02:07
inet addr:10.20.30.40 Bcast:10.20.30.255 Mask:255.255.255.0
inet6 addr: fe80::82fa:5bff:fe4c:207/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:63252 errors:0 dropped:0 overruns:0 frame:0
TX packets:40966 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:53814860 (53.8 MB) TX bytes:5441842 (5.4 MB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:7029 errors:0 dropped:0 overruns:0 frame:0
TX packets:7029 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:650606 (650.6 KB) TX bytes:650606 (650.6 KB)
At this point, I can ping each of my DNS servers via their IP addresses.
Furthermore, remote sites can ping my ubuntu host both by its static IP address and also by the name host-o-rama-bama.com
, which is already set up on the DNS servers. I can even ssh into my host both via its IP address and its DNS name.
However, I cannot see any domain names from the ubuntu machine, but , I can indeed access anywhere I want on the net via ssh, telnet, http, ping, etc. as long as I use the IP address.
In /etc/resolvconf/resolv.conf.d/base
, I put the following, and then I ran resolvconf -u
...
domain host-o-rama-bama.com
search host-o-rama-bama.com
nameserver 100.110.120.130
nameserver 100.110.120.140
However, after running it, the DNS is still not working.
I put the following into /etc/network/interfaces
...
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto enp2s0f1
iface enp2s0f1 inet static
address 10.20.30.40
netmask 255.255.255.0
gateway 10.20.30.1
dns-nameserver 100.110.120.130
dns-nameserver 100.110.120.140
dns-search host-o-rama-bama.com
I then did the following:
# ifdown enp2s0f1
# ifup enp2s0f1
Nothing changed. The DNS is still not working.
I then commented out everything in /etc/network/interfaces
from the auto enp2s0f1
line to the bottom of the file and then did this ...
# ifdown -a
# ifup -a
Still no DNS.
I then tried this ...
# /etc/init.d/network-manager stop
# /etc/init.d/network-manager start
The DNS is still not working.
Then, I did this:
# service networking restart
... and still no DNS.
What am I missing?
Thank you in advance.
Try to install the full dnsmasq package (On Ubuntu only dnsmasq-base is installed by default) :
sudo apt-get install dnsmasq
, then edit /etc/dnsmasq.conf (add your DNS server : server=8.8.8.8 for example). Restart dnsmasq and network manager services (sudo service dnsmasq restart; sudo service network-manager restart
).Hope this work.
I consider this question to be answered now. The
dnsmasq
suggestion is worthwhile, but the situation didn't get fixed until I completely reinstalled Ubuntu 16.04 from scratch. My guess is that I did something during the original installation (??? not sure what) which prevented my DNS from working.I need to remember that one possible solution to these kinds of seemingly intractable problems is: "Reinstall from scratch and try again." :)
Thanks to Eraseth and chili555 for all your help.
Excelsior! (Latin for "Onward and upward!")