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

Documentation erronenous: domain records should end in a "." #4

Closed
dm-coding opened this issue Dec 23, 2017 · 0 comments
Closed

Documentation erronenous: domain records should end in a "." #4

dm-coding opened this issue Dec 23, 2017 · 0 comments

Comments

@dm-coding
Copy link

dm-coding commented Dec 23, 2017

Although the library (or possibly the PDNS API) correctly interprets "test" to mean "test.example.org", it causes a "DNS Record is not canonical" error to be returned:

fatal: [nicola.noflag.org.uk]: FAILED! => {"changed": false, "failed": true, "msg": "Could not create record test..noflag.org.uk: HTTP 422: DNS Name 'test.example.org' is not canonical"}

This exact error occurs when the domain record is both "test" and "test.example.org", the returned string is identical in both cases (!!)

The only reference to this error is here where they suggest adding a dot and it looks from the source code here (line 412) that its tripping a function which expects the domain record to end in a "." as well. When I submitted the domain record as "test.example.org." instead of "test", the library worked more or less as expected.

I believe the documentation should be updated to reflect this --- will submit a patch in the morning.

`Ensure A record

  • powerdns_record:
    name: host01.internal.example.com.
    zone: zone01.internal.example.com
    type: A
    content: 192.168.1.234
    ttl: 1440
    pdns_host: powerdns.example.com
    pdns_port: 8081
    pdns_api_key: topsecret`

This also effects zones with an error like {"msg": "Could not create zone example.org: HTTP 422: https://ns0.noflag.org.uk:443/api/v1/servers/localhost/zones: DNS Name 'example.org' is not canonical", "failed": true, "invocation": {"module_args": {"pdns_port": 443, "pdns_api_key": "xxx", "kind": "master", "name": "example.org", "nameservers": ["ns2.noflag.org.uk.", "n1.noflag.org.uk."], "masters": null, "pdns_host": "ns0.noflag.org.uk", "state": "present", "pdns_prot": "https", "server": "localhost"}}}

And nameservers with an error like {"msg": "Could not create zone example.org.: HTTP 422: https://ns0.noflag.org.uk:443/api/v1/servers/localhost/zones: Nameserver is not canonical: 'ns2.noflag.org.uk'", "failed": true, "invocation": {"module_args": {"pdns_port": 443, "pdns_api_key": "xxx", "kind": "master", "name": "example.org.", "nameservers": ["ns2.noflag.org.uk", "n1.noflag.org.uk"], "masters": null, "pdns_host": "ns0.noflag.org.uk", "state": "present", "pdns_prot": "https", "server": "localhost"}}}

It would perhaps be best to have the library itself check for the presence or absence of a dot at the end of the string for zones, records and nameservers.

dm-coding pushed a commit to dm-coding/ansible-module-powerdns that referenced this issue Dec 23, 2017
…f not present causes "Domain record is not canonical" error. Closes issue Nosmoht#4 (Nosmoht#4)
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

1 participant