Adding DNS Resolver Addresses using a script
-
Hi all
Is there a way to script adding entries.
If someone can point me at a example would be great, building Kubernetes clusters with multiple nodes and multiple interfaces and ye... doing it at ui is getting a bit :(
G
-
@georgelza how I would do it is include some text file that contains your entries
Example
[24.03-RELEASE][admin@sg4860.home.arpa]/var/unbound: cat newhosts.conf local-data: "newhost.newdomain.tld. A 10.11.12.13" local-data: "otherhost.otherdomain.tld. A 10.11.12.14" [24.03-RELEASE][admin@sg4860.home.arpa]/var/unbound:
So you could script adding whatever records you want in there like the above.. you can create ptr records as well with local-data-ptr:
And then have your script restart unbound so those are loaded..
edit: btw, not really sure what might happen to that text file you create with your records on an update to pfsense or even the unbound package.. So you might want to keep a copy handy of what you put in there.
Another way would be directly editing the xml to put your hosts in there as overrides - but that seems more complex and possible corruption of your configuration of pfsenses overall xml.. The loading of text file seems way less intrusive and easier to accomplish with simple script and less risk of borking something up.