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

Incorrect reference to templates that contain white space #321

Closed
karlism opened this Issue May 31, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@karlism

karlism commented May 31, 2016

If empty zone file is created (only containing NS records) and the template name contains white space (for example, "Test Template"), incorrect DNAME alias is inserted in zone file:

===========================================================================
/master/db.test-zone.local.hosts:
===========================================================================
; This file was built using fmDNS 2.2.2 on 31/05/2016 14:15:01 +0100 Europe/London
$TTL 2h
test-zone.local. IN SOA master.example.com. hostmaster.example.com. (
2016053101 ; Serial
5m ; Refresh
2m ; Retry
4w ; Expire
2h ) ; Negative caching of TTL
; Name servers
test-zone.local. IN NS ns.example.com.
; Aliases
test-zone.local. IN DNAME Test Template. <<<- mistake here

named-checkzone fails validating such zone by following error:
dns_rdata_fromtext: /etc/named/zones/master/db.test-zone.local.hosts:15: near 'Template.': extra input text
zone test-zone.local/IN: loading from master file /etc/named/zones/master/db.test-zone.local.hosts failed: extra input text
zone test-zone.local/IN: not loaded due to errors.

Renaming the template to "Test_Template" solves the issue.

You should probably disallow zone template names with white spaces or other special symbols or insert DNAME record with quotes.

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented May 31, 2016

Thanks for the report. Are you manually creating the DNAME RR? Clones may automatically create a DNAME, but that wouldn't be based on a template. Could you please provide the steps to reproduce this behavior?

@WillyXJ WillyXJ added the fmDNS label May 31, 2016

@karlism

This comment has been minimized.

karlism commented Jun 1, 2016

Steps to reproduce this bug are following:

  1. Add Template with domain name: "Test 123"
  2. Add 1 NS record to that template: "ns.test123.local."
  3. Create new forward zone for domain: "test456.local" and use "Test 123" template for it
  4. Validate and submit zone (without adding any new host records)
  5. Deploy configuration to DNS servers

Thank you for your help!

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Jun 1, 2016

Thank you for the steps. Even then I still had a hard time reproducing the error until I ticked the "Use DNAME Resource Records for Clones" fmDNS setting. It seems this setting is incorrectly being used for templates as it's only supposed to be used for clones. A fix for this should be included in the next release.

@WillyXJ WillyXJ added this to the 2.x bug fixes milestone Jun 8, 2016

@WillyXJ

This comment has been minimized.

Owner

WillyXJ commented Jun 14, 2016

This is fixed in fmDNS 2.2.3.

@WillyXJ WillyXJ closed this Jun 14, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment