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

Allow "type forward" without file-statement #64

Closed
byteSamurai opened this issue Dec 2, 2014 · 3 comments
Closed

Allow "type forward" without file-statement #64

byteSamurai opened this issue Dec 2, 2014 · 3 comments

Comments

@byteSamurai
Copy link

As far as I see, its currently not possible to add a forward only zone, because the "file"-statement is not allow while using type forward

zone "domain.tld" {
    type forward;
    forward only;
    #file [...] (not allowed)
    forwarders {
                123.123.123.123; // dns-server of domain.tld
        };
};

I really far away being a ruby expert, so: Is this a fix?
_zone.erb_

zone "<%= @zone %>" {
  type <%= @zone_type %>;
<% if @zone_notify -%>
  notify <%= @zone_notify %>;
<% end -%>
<% if @zone_type != "forward" %>
  file "<%= @zone_file %>";
<% end -%>
<% if @zone_type == 'slave' -%>
  masters { <%= @slave_masters %>;};
<% elsif @zone_type == 'master' or   @zone_type == 'forward'-%>
<% if @allow_transfer -%>
  allow-transfer {
<% @allow_transfer.each do |ip| -%>
  <%= ip %>;
<% end -%>
  };
<% end -%>

<% if !@allow_forwarder.empty? -%>
  forward <%= @forward_policy %>;
  forwarders {
<% @allow_forwarder.each do |ip| -%>
  <%= ip %>;
<% end -%>
  };
<% end -%>
<% end -%>

};
@solarkennedy
Copy link
Collaborator

I think that would be fine. I would accept a PR if it was accompanied with tests for this.

I agree that the file line should not be there on a forward zone
ftp://ftp.isc.org/isc/bind9/cur/9.10/doc/arm/Bv9ARM.ch06.html#zone_statement_grammar

@byteSamurai
Copy link
Author

okay I try to do it next week

@roderickm
Copy link
Contributor

This issue can be closed. The suggested changes and tests were committed in 19ebe75.

@ajjahn ajjahn closed this as completed Nov 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants