Saturday, 2 January 2016

How to enable name resolution for Ubuntu 14.04 server using resolv.conf,DNSMasq and network configuration

Recently I faced the issue where in one of my Ubuntu servers, I'm unable to set up the name servers in /etc/resolv.conf . Whenever I set this and restart networking or resolvconf, it is getting overwritten. This was causing me issues as I'm unable to ping This is what I'm getting when I ping.

[email protected]:~# ping
ping: unknown host

So the solution is to edit the /etc/network/interfaces file and add the entry "dns-nameservers" .

My network configuration is given below:

[email protected]:~# cat /etc/network/interfaces 
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static

Then restart networking.

[email protected]:~# /etc/init.d/networking restart
 * Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
 * Reconfiguring network interfaces...                                                                                                                                  ssh stop/waiting
ssh start/running, process 6194

You can see that ping is now working fine.

[email protected]:~# ping
PING ( 56(84) bytes of data.
64 bytes from ( icmp_req=1 ttl=55 time=9.84 ms
64 bytes from ( icmp_req=2 ttl=55 time=10.9 ms

No comments:

Post a Comment