Author Topic: Setting persistent nameserver in /etc/resolv.conf  (Read 830 times)

jon.snow

  • Zen Apprentice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Setting persistent nameserver in /etc/resolv.conf
« on: June 23, 2017, 09:12:32 pm »
I have stood up a DC and BDC using Zentyal 5.0.8. each with the following modules installed: Network, Firewall, DNS, Logs, NTP, Domain Controller and File Sharing

I had to manual change /etc/resolv.conf in order to get my BDC joined to the primary.  This is also what I would like to have on each DC after a reboot:
Code: [Select]
nameserver 192.168.1.191
nameserver 192.168.1.192
search mydomain.local

Currently, after a reboot of each server my DC /etc/resolv.conf looks like this:
Code: [Select]
nameserver 127.0.01
nameserver 192.168.1.1
search mydomain.local
and my BDC /etc/resolv.conf looks like this:
Code: [Select]
nameserver 192.168.1.1
search mydomain.local

I found in Network > DNS, setting the Search Domain allows the configured domain to get set as search in /etc/resolv.conf after a reboot.

I am unable to find where to set the nameserver values so that they are loaded as well after a reboot.  The documentation suggests that it should be configurable in Network > DNS but I seem to be missing this configuration option.
https://wiki.zentyal.org/wiki/File:En-5.0-images-firststeps-dns.png

I tried to configure a Forwarder on each DC in DNS > Forwarders pointing to the other DC but this does not seem to change anything in /etc/resolv.conf after a reboot.

I also made sure both name servers were configured in DNS > mydomain.local > Name servers.  This also does not seem to change anything in /etc/resolv.conf after a reboot.

Any suggestions or help on how to ensure resolv.conf gets sets properly following a reboot is appreciated.
« Last Edit: June 24, 2017, 12:30:36 am by jon.snow »

johnakki

  • Zen Apprentice
  • *
  • Posts: 6
  • Karma: +1/-0
    • View Profile
Re: Setting persistent nameserver in /etc/resolv.conf
« Reply #1 on: August 15, 2017, 10:06:14 pm »
/etc/resolv.conf is a symlink nowadays and is managed by resolvconf.
Couple of options - /etc/resolvconf.conf (or /etc/resolvconf.d/ depending on distro) contains the config for resolvconf - you can specify custom DNS servers, domains and whatever else in here.
If you find that it's still misbehaving though, the easiest thing may be to just delete the /etc/resolv.conf symlink and replace it with a real file which contains the settings you want it to have. I would just add a note at the top of resolv.conf explaining what you've done and why.

jon.snow

  • Zen Apprentice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Setting persistent nameserver in /etc/resolv.conf
« Reply #2 on: August 31, 2017, 08:48:35 pm »
I ended up having to replace it with a static file as you suggested, thanks.

Dejavu_Dmitry

  • Zen Apprentice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Setting persistent nameserver in /etc/resolv.conf
« Reply #3 on: January 15, 2019, 04:25:43 pm »
/etc/resolv.conf is a symlink nowadays and is managed by resolvconf.
Couple of options - /etc/resolvconf.conf (or /etc/resolvconf.d/ depending on distro) contains the config for resolvconf - you can specify custom DNS servers, domains and whatever else in here.
If you find that it's still misbehaving though, the easiest thing may be to just delete the /etc/resolv.conf symlink and replace it with a real file which contains the settings you want it to have. I would just add a note at the top of resolv.conf explaining what you've done and why.
Okay, but what about disappeared entries and options in web-interface? Because I have same problem.