xcat-core icon indicating copy to clipboard operation
xcat-core copied to clipboard

Howto add additional dns options to makedns or named.conf

Open OliverTUBAF opened this issue 2 years ago • 3 comments
trafficstars

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

OliverTUBAF avatar Dec 13 '22 09:12 OliverTUBAF

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.

Obihoernchen avatar Jan 09 '23 20:01 Obihoernchen

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.

OliverTUBAF avatar Jan 11 '23 07:01 OliverTUBAF

@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

kcgthb avatar Jan 19 '23 19:01 kcgthb