Trying to replace all the forwarders with new ones but I can't seem to the pattern matching to work. I can't see the mistake for the life of me:
sudo sed -i .bak "s/forwarders {[^]]*}/forwarders { 127.0.0.1 }/g" /etc/named/named.conf
Trying to replace all the forwarders with new ones but I can't seem to the pattern matching to work. I can't see the mistake for the life of me:
sudo sed -i .bak "s/forwarders {[^]]*}/forwarders { 127.0.0.1 }/g" /etc/named/named.conf
This is how I would do it. There are probably more creative ways.
It is far, far much easier to update the
named.conf
file if you also place strategically your settings using theinclude
pragma.then your bash script can simply do
This
include
has been around since ISC Bind v8.0 and can be placed anywhere within thenamed.conf
and can even be include-nested up to 16 times, although I have done 4-deep include nesting myself without any effect; i useinclude
to separate each clause plus keys, ACL, dynamic IP address,a working example of
include
with my hidden-master’snamed.conf
here: