Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makedns does not support "forward only" option #5958

Closed
adambertsch opened this issue Jan 17, 2019 · 10 comments
Closed

makedns does not support "forward only" option #5958

adambertsch opened this issue Jan 17, 2019 · 10 comments

Comments

@adambertsch
Copy link

For a DNS environment that uses the forwarders= option in named.conf, it would also be good (and in many cases necessary) to support the forward-only option. Today makedns creates the following named.conf file when forwarders are specified:

#generated by xCAT: /opt/xcat/sbin/makedns command
options {
        directory "/var/named/";
        allow-recursion { any; };
        forwarders {
                x.y.z.1;
                x.y.a.1;
        };
        empty-zones-enable no;
};

What we would like to do is have another site table option (forward-only=true, or something like that) to enable makedns to generate the following:

#generated by xCAT: /opt/xcat/sbin/makedns command
options {
        directory "/var/named/";
        allow-recursion { any; };
        forwarders {
                x.y.z.1;
                x.y.a.1;
        };
        forward only;
        empty-zones-enable no;
};
@immarvin
Copy link
Contributor

this ticket is somehow similar with a previous ticket #5897.

I suggest xCAT provide a general way to specify/preserve user customized options, since named/dhcp has so many options

@robin2008
Copy link
Member

For most of the configuration management tool, they generates the config file based on a template. For experienced Admin, they can modify the template to get the great flexibility.

Or xcat allow modify the config file for those xcat not covered, but keep the changes when makedns again.

@bybai
Copy link
Contributor

bybai commented Jan 21, 2019

Since forward has value first and only, plan to add forwardmode site table option to generate the config file.

@whowutwut
Copy link
Member

@adambertsch Did you want us to start looking into this issue or did you want to tackle it? @bybai assigned it to herself and will start the work unless you tell us otherwise 😸

@adambertsch
Copy link
Author

I'm on vacation, so I wont be looking at much this week. So if you guys take care of it I'll only be thankful.

@cxhong
Copy link
Contributor

cxhong commented Mar 27, 2019

Maybe I should post here, instead in the PR
I verified this PR on boston02 with March 26th build.
The service node /etc/named.conf didn't change for whatever values I set to for setupnameserver and dnsforwardmode

[root@sn02 etc]# ls -ltr named.conf.ORIG named.conf
-rw-r----- 1 root root  259 Mar 26 13:55 named.conf.ORIG
-rw-r----- 1 root named 259 Mar 26 13:55 named.conf
[root@sn02 etc]# cat named.conf
options {
        directory "/var/named";
        dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        recursion yes;
        forward only;
        forwarders {
                172.20.253.31;
        };
};

@bybai
Copy link
Contributor

bybai commented Mar 28, 2019

@cxhong, this issue is about how to customize forward mode in named.conf.
I think your meaning about "forwarders { 172.20.253.31; };" is not changed in SN, this part is our setupnameserver feature control, in your example, it should be "setupnameserver=1" result.
"forward mode" is different function from "setupnameserver" or "customize forwarders" in SN, here our user do not complain about "customize forwarders", so I think support customize "forward mode" is the user requirement, and keep "setupnameserver" function the same as before in SN. Thanks.

@cxhong
Copy link
Contributor

cxhong commented Mar 28, 2019

Ok, I just followed your unit testing in the PR #5970. The results are different from what you showed on the Hierarchy cluster.

@bybai
Copy link
Contributor

bybai commented Mar 29, 2019

Hi @cxhong,
I guess your meaning is that "forwarders" are not changed in sn02?
I think you do not run makedns -n in sn02. I only add "forward only|first;"changes here.
After running "makedns -n" in MN or SN, "forward only" or "forward first" take effect in its /etc/named.conf. If we do not execute "makedns -n" on SN, the /etc/named.conf in SN will not have changes. And other parts of /etc/named.conf did not changed in this PR. I am sorry that I did not mention to run "makedns -n" on SN in PR, and I carefully checked the PR description and refined it.

Your above checks covers "execute makedns -n on MN, and not run makedns on SN scenario",
if you run makedns -n in sn02, the /etc/named.conf is changed.

[root@sn02 ~]# cat /etc/named.conf
options {
	directory "/var/named";
	dump-file "/var/named/data/cache_dump.db";
	statistics-file "/var/named/data/named_stats.txt";
	memstatistics-file "/var/named/data/named_mem_stats.txt";
	recursion yes;
	forward only;
	forwarders {
		172.20.253.31;
	};
};

[root@sn02 ~]# makedns -n
Handling localhost in /etc/hosts.
Handling localhost in /etc/hosts.
Getting reverse zones, this may take several minutes for a large cluster.
Completed getting reverse zones.
Updating zones.
Completed updating zones.
Restarting named
Restarting named complete
Updating DNS records, this may take several minutes for a large cluster.
Completed updating DNS records.
DNS setup is completed

[root@sn02 ~]# cat /etc/named.conf
#generated by xCAT: /opt/xcat/sbin/makedns command
options {
	directory "/var/named/";
	allow-recursion { any; };
	forwarders {
		10.6.29.1;
	};
	forward only;
	empty-zones-enable no;
	notify yes;
	allow-transfer {
		172.20.254.2;
	};
	also-notify {
		172.20.254.2;
	};
};

@bybai bybai modified the milestones: 2.14.6, 2.15 Mar 29, 2019
@cxhong
Copy link
Contributor

cxhong commented Mar 29, 2019

Thanks @bybai

@cxhong cxhong closed this as completed Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants