Skip to content

Not able to add RR to zone  #2

@muellerlukas

Description

@muellerlukas

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions