Making resolv.conf changes permanant

David Fletcher dave at thefletchers.net
Thu Apr 30 17:35:05 UTC 2015


On Thu, 2015-04-30 at 11:39 -0500, Chris wrote:
> I too like Steven in another post am trying to setup Bind9 to work as a
> caching name server. I can manually change /etc/resolv.conf to show:
> 
> nameserver 192.168.0.1

Don't know if this is relevant to you or not, but I seem to remember
hand editing /etc/resolv.conf to get access to a name server. Can't do
it any more as per the warning.

Last time I set up my server afresh with server 14.04 late last year, I
experimented first with a virtual machine and updated my setup notes
accordingly, then took down my real server and put in a fresh hard
drive. In my notes:-

Set up networking:-
Edit /etc/network/interfaces to look like this:-
{
# interfaces(5) file used by ifup(8) and ifdown(8)

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
# iface eth0 inet dhcp
# Changes to:-
iface eth0 inet static
  address         192.168.2.x
  netmask         255.255.255.0
  network         192.168.2.0
  broadcast       192.168.2.255
  gateway         192.168.2.1
  dns-nameservers 192.168.2.1 8.8.8.8
}

and on my running server:-

dave at ServerIII:~$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by
resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.2.1
nameserver 8.8.8.8
dave at ServerIII:~$ 

I'm by no stretch of the imagination a networking expert but this is
working nicely for me.

Dave






More information about the ubuntu-users mailing list