xcat2 / xcat-core

Code repo for xCAT core packages
Eclipse Public License 1.0
369 stars 172 forks source link

Howto add additional dns options to makedns or named.conf #7303

Open OliverTUBAF opened 1 year ago

OliverTUBAF commented 1 year ago

Dear All,

I need to set the named option "filter-aaaa-on-v4 yes;". I can do this manually and restart the service, but if I use makedns, this option disappears from named.conf. Is there a way to make this change persistent using xcat means?

Thanks in advance!

Regards

Obihoernchen commented 1 year ago

Unfortunately this is not possible, but you could add your changes to /opt/xcat/lib/perl/xCAT_plugin/dhcp.pm.

Edit: Ups ddns.pm, not dhcp.pm of course.

OliverTUBAF commented 1 year ago

Dear Obihoernchen,

thank you for that useful hint! In fact the file that I needed to change was /opt/xcat/lib/perl/xCAT_plugin/ddns.pm . Starting with line 1271 the named.conf gets written, so I added the following line there:

--- /opt/xcat/lib/perl/xCAT_plugin/ddns.pm.dist 2020-03-04 22:43:28.000000000 +0100
+++ /opt/xcat/lib/perl/xCAT_plugin/ddns.pm  2023-01-11 07:51:23.374066039 +0100
@@ -1270,6 +1270,7 @@
     }
     unless ($gotoptions) {
         push @newnamed, "options {\n";
+        push @newnamed, "\tfilter-aaaa-on-v4 yes;\n";
         push @newnamed, "\tdirectory \"" . $ctx->{zonesdir} . "\";\n";
         unless ($slave && xCAT::Utils->isLinux()) {
             push @newnamed, "\tallow-recursion { any; };\n";

This would also work for all other named options, that are not configureable through xcat.

kcgthb commented 1 year ago

@OliverTUBAF you can also maybe use site.namedincludes to include external files in the generated named.conf?

https://xcat-docs.readthedocs.io/en/stable/guides/admin-guides/references/man5/site.5.html?highlight=namedincludes#site-attributes