coredns_mysql
coredns_mysql copied to clipboard
Not able to add RR to zone
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
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.
+1 for that issue, having the same problem