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

forward zone breaks build_bind #20

Open
dmgeurts opened this issue Sep 30, 2020 · 5 comments
Open

forward zone breaks build_bind #20

dmgeurts opened this issue Sep 30, 2020 · 5 comments
Assignees
Labels

Comments

@dmgeurts
Copy link

Splitting off some domains to another platform and now bind configs fail to build.

root@unifipi:/opt/ona# bin/build_bind -t
Sep 30 23:56:53 [ONA:build_bind]: INFO => Building BIND DNS config for ona1.gc...
Sep 30 23:56:58 [ONA:build_bind]: INFO => Scanning for footers on remote server ...
Sep 30 23:56:58 [ONA:build_bind]: INFO => Testing new config files for SYNTAX only...
/etc/bind/named.conf.options:55: option 'dnssec-enable' is obsolete and should be removed 
/opt/ona/etc/bind/named.conf.ona:47: missing ';' before 'zone'
/opt/ona/etc/bind/named.conf.ona:65: missing ';' before 'zone'
/etc/bind/named.conf:11: missing ';' before 'include'
Sep 30 23:56:58 [ONA:build_bind]: ERROR => The resulting config files contain one or more syntax errors.

opt/ona/etc/bind/named.conf.ona:47: missing ';' before 'zone' <<< shown below.

...
zone "mm.eu" in {
  type forward;
  file "/opt/ona/etc/bind/zone_data/named-mm.eu";}
zone "254.31.172.in-addr.arpa" in {
  type master;
  file "/opt/ona/etc/bind/zone_data/named-254.31.172.in-addr.arpa";
};
...

It looks like some line feeds and a ";" are missing. I have three forwards defined and they all suffer the same issue after the zone definition.

@mattpascoe mattpascoe self-assigned this Oct 1, 2020
@mattpascoe mattpascoe transferred this issue from opennetadmin/ona Oct 1, 2020
@mattpascoe mattpascoe added the bug label Oct 1, 2020
mattpascoe added a commit that referenced this issue Oct 1, 2020
Looks like forward zones did not have proper stanza endings.
@mattpascoe
Copy link
Member

@dmgeurts give this branch a try and see if it fixes the issue. I have not personally tested this in any way and in fact, edited it all in the github website.

I'm hoping it should just be this simple.. it looks like I didnt make the same change to the forward section as was made to the master section.

Thanks

@mattpascoe
Copy link
Member

Hmm.. come to think of it.. I dont think forward zones ever worked. as indicated by line 231, I need to point it an an IP address.. I think the reason this is not currently implemented is that the database and gui have no current ability to manage the IP that you would point it to.

As a workaround, you should be able to just define the zone as a separate file and then add an include in your named.conf file.

.....Sadly I'm trying to solve this problem in my head from memory, instead of actually trying things out to see if it works or is even viable. I should probably just stop helping.. I figured I could use the few mins I had to actually move it forward. :)

@dmgeurts
Copy link
Author

dmgeurts commented Oct 1, 2020

It would be enough to resolve the ip's of the master DNS servers set and use those as forwarders. So it shouldn't be hard to use the information available.

I'll have a look and see if I can make sense of the code in order to contribute.

@dmgeurts
Copy link
Author

dmgeurts commented Oct 2, 2020

Fixed it, please review master...dmgeurts:patch-1

@dmgeurts
Copy link
Author

dmgeurts commented Oct 3, 2020

To explain the fix:

  1. ONA must have the IP address for the target (master) server in its database. For me this means an A record in the forward zone, as the forwarding target server is part of the forwarded zone.
  2. Add ONA server(s) as FORWARD(ing) server(s), and add target server(s) as MASTER server(s)
  3. build_bind will now ignore the zone file, instead it will list the forwarding servers in /opt/ona/etc/bind/named.conf.ona

Example /opt/ona/etc/bind/named.conf.ona:

zone "0.16.172.in-addr.arpa" in {
  type master;
  file "/opt/ona/etc/bind/zone_data/named-0.16.172.in-addr.arpa";
};

zone "172.in-addr.arpa" in {
  type forward;
  forwarders { 192.168.1.254;   };
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants