Hello,
I am using bind+isc-dhcp-server, my ISP give me IP by DHCP. I need entry in resolv.conf:
domain mydomain.local
search mydomain.local
nameserver 127.0.0.1
Every refresh od DHCP overwrite resolv.conf back to ISP nameservers. How can I prevet this ?
Thank you for help.
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Prevent resolv.conf overwrite by DHCP
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 132 times
Re: Prevent resolv.conf overwrite by DHCP
Install the resolvconf package and set the nameservers in /etc/network/interfaces, see interfaces(5) for details.
I've never used isc-dhcp-server but you may be able to stop it over-writing /etc/resolv.conf by editing /etc/dhcp/dhcpd.conf, I know that is possible with Debian's usual dhclient package.
Also, even if your ISP uses DHCP it may still be possible to define static addresses if you prefer.
Finally, bind is extemely crusty, have you tried unbound?
I've never used isc-dhcp-server but you may be able to stop it over-writing /etc/resolv.conf by editing /etc/dhcp/dhcpd.conf, I know that is possible with Debian's usual dhclient package.
Also, even if your ISP uses DHCP it may still be possible to define static addresses if you prefer.
Finally, bind is extemely crusty, have you tried unbound?
deadbang
-
- Posts: 73
- Joined: 2014-11-14 05:30
Re: Prevent resolv.conf overwrite by DHCP
Thank you,
I can set dns-nameservers to interfaces but I need also domain and search.
Bind works good. Before I using dnsmasq. Now I have more interfaces and network and need zones with ddns to isc-dhcp-server.
I can set dns-nameservers to interfaces but I need also domain and search.
Bind works good. Before I using dnsmasq. Now I have more interfaces and network and need zones with ddns to isc-dhcp-server.
-
- Posts: 73
- Joined: 2014-11-14 05:30
Re: Prevent resolv.conf overwrite by DHCP
Solved, here is how to:
sudo nano /etc/dhcp/dhclient-enter-hooks.d/nodnsupdate
Type this to file nodnsupdate:
Make it exacutable:
sudo chmod +x nodnsupdate
Reboot. It is done after reboot all entry I manually add to resolv.conf stay.
Hope this will be usefull for others.
sudo nano /etc/dhcp/dhclient-enter-hooks.d/nodnsupdate
Type this to file nodnsupdate:
Code: Select all
#!/bin/sh
make_resolv_conf(){
:
}
sudo chmod +x nodnsupdate
Reboot. It is done after reboot all entry I manually add to resolv.conf stay.
Hope this will be usefull for others.
- sunrat
- Administrator
- Posts: 6412
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 116 times
- Been thanked: 462 times
Re: Prevent resolv.conf overwrite by DHCP
Alternatively you can set the DNS servers with a line in dhclient.conf:
That's for OpenDNS so replace with your desired IP addresses.
Code: Select all
supersede domain-name-servers 208.67.222.222,208.67.220.220;
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!