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

Not able to add RR to zone #2

Open
muellerlukas opened this issue Sep 8, 2021 · 2 comments
Open

Not able to add RR to zone #2

muellerlukas opened this issue Sep 8, 2021 · 2 comments

Comments

@muellerlukas
Copy link

Hi there,

first: Thanks for the plugin. Really nice and easy to get to work.

But I think I found a bug: Currently it is impossible to create records for a zone itself. Only for subdomains.

Based on your examples I am using foo.example.org as zone name.

When a request for "test.foo.example.org" is received, the completed name ist "test.foo.example.org."
"." + Zonename (".foo.example.org.") is stripped out. Thats right.
So the query is:

SELECT name, zone, ttl, record_type, content FROM coredns_records WHERE zone = 'foo.example.org.' AND name = 'test' AND record_type IN ('A')

But when you do a request for "foo.example.org" also ".foo.example.org." is tried to stripped out. This fails of course. The final query is:

SELECT name, zone, ttl, record_type, content FROM coredns_records WHERE zone = 'foo.example.org.' AND name = 'foo.example.org.' AND record_type IN ('A')

This does not find any records. If I try to use the data like in the query given the result will be for "foo.example.org.foo.example.org" which also causes an error.

I think the easiest solution is to set the name empty if the name matches the zone.

Thanks and greetings from Germany
Lukas

@khash
Copy link
Member

khash commented Sep 20, 2021

Thank you @muellerlukas for the report and suggestion. Given the differences in the queries based on clients, we're going to review this further to make sure your suggested fix is not breaking other apex queries.

@gris-gris
Copy link

+1 for that issue, having the same problem

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

3 participants