Skip to content

IDNA handling for records is incomplete in dnscontrol #3842

@das7pad

Description

@das7pad

It looks like IDNA handling for records is incomplete in dnscontrol. Take this minimal config, note the ä in the domain:

var REG_NONE = NewRegistrar('none')
var DSP = NewDnsProvider('HETZNER_V2')

D('testing-2025-11-17-ä.dev', REG_NONE, DnsProvider(DSP),
  A('@', '127.0.0.1'),
  A('foo', '127.0.0.1')
)

Logging the first.Name here will print the record name with origin:

CREATE first.Name="xn--testing-2025-11-17--ywb.dev"
CREATE first.Name="foo.xn--testing-2025-11-17--ywb.dev"
DONE
******************** Domain: testing-2025-11-17-ä.dev
2 corrections (HETZNER_V2)
#1: + CREATE xn--testing-2025-11-17--ywb.dev A 127.0.0.1 ttl=300
SUCCESS!
#2: + CREATE foo.xn--testing-2025-11-17--ywb.dev A 127.0.0.1 ttl=300
SUCCESS!

And the next listing will find the records with the FQDN

.Type="NS" input="@" -> .Name="@" .NameFQDN="xn--testing-2025-11-17--ywb.dev"
.Type="A" input="xn--testing-2025-11-17--ywb.dev" -> .Name="xn--testing-2025-11-17--ywb.dev" .NameFQDN="xn--testing-2025-11-17--ywb.dev.xn--testing-2025-11-17--ywb.dev"
.Type="A" input="foo.xn--testing-2025-11-17--ywb.dev" -> .Name="foo.xn--testing-2025-11-17--ywb.dev" .NameFQDN="foo.xn--testing-2025-11-17--ywb.dev.xn--testing-2025-11-17--ywb.dev"

Which we can confirm with a DNS query:

$  dig foo.xn--testing-2025-11-17--ywb.dev @hydrogen.ns.hetzner.com
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 11474

$ dig foo.xn--testing-2025-11-17--ywb.dev.xn--testing-2025-11-17--ywb.dev @hydrogen.ns.hetzner.com
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8090
foo.testing-2025-11-17-ä.dev.testing-2025-11-17-ä.dev. 300 IN	A 127.0.0.1

And dnscontrol wants to correct again, but will fail due to unique constraints on the provider side:

DONE
******************** Domain: testing-2025-11-17-ä.dev
3 corrections (HETZNER_V2)
#1: + CREATE xn--testing-2025-11-17--ywb.dev A 127.0.0.1 ttl=300
FAILURE! RRSet already exists (uniqueness_error, c252db090655f464300b6127609cf299)
#2: - DELETE xn--testing-2025-11-17--ywb.dev.xn--testing-2025-11-17--ywb.dev A 127.0.0.1 ttl=300
SUCCESS!
#3: - DELETE foo.xn--testing-2025-11-17--ywb.dev.xn--testing-2025-11-17--ywb.dev A 127.0.0.1 ttl=300
SUCCESS!
#4: + CREATE foo.xn--testing-2025-11-17--ywb.dev A 127.0.0.1 ttl=300
SUCCESS!

And with a simple domain testing-2025-11-17-ä.dev -> testing-2025-11-17-1.dev, I'm getting the bare label, and everything works as expected:

CREATE first.Name="@"
CREATE first.Name="foo"
DONE
******************** Domain: testing-2025-11-17-1.dev
2 corrections (HETZNER_V2)
#1: + CREATE testing-2025-11-17-1.dev A 127.0.0.1 ttl=300
SUCCESS!
#2: + CREATE foo.testing-2025-11-17-1.dev A 127.0.0.1 ttl=300
SUCCESS!

Next listing:

.Type="NS" input="@" -> .Name="@" .NameFQDN="testing-2025-11-17-1.dev"
.Type="A" input="@" -> .Name="@" .NameFQDN="testing-2025-11-17-1.dev"
.Type="A" input="foo" -> .Name="foo" .NameFQDN="foo.testing-2025-11-17-1.dev"

DNS query:

$ dig foo.testing-2025-11-17-1.dev @hydrogen.ns.hetzner.com
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31856
foo.testing-2025-11-17-1.dev. 300 IN	A	127.0.0.1

Originally posted by @das7pad in #3837 (comment)

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