Skip to content

DNS encoding should follow RFC4343 or utf8 #39398

Open
@martinheidegger

Description

@martinheidegger

Version

v16.4.0

Platform

Darwin ~.local 20.5.0 Darwin Kernel Version 20.5.0: root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64

Subsystem

dns

What steps will reproduce the bug?

dns.resolveTxt('_dnslink.t17.dnslink.dev', (err, data) => console.log({ err, data }))

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior?

Output according to RFC4343#section-2.1 with \ encoding, similar to dig +short TXT _dnslink.t17.dnslink.dev:

{
  err: null,
  data: [
    //...
    [ 'dnslink=/dnslink/b\195\188cher' ],
    [ 'dnslink=/dnslink/cool.foo..foo/bar' ],
    [ 'dnslink=/dnslink/domain.com\194\169' ],
    [ 'dnslink=/dnslink/domain.com\239\191\189' ],
    //...
    [ 'dnslink=/dnslink/\208\191\209\128\208\181\208\183\208\184\208\180\208\181\208\189\209\130.\209\128\209\132' ],
    [ 'dnslink=/dnslink/\230\151\165\230\156\172\232\170\158.jp' ],
    [ 'dnslink=/dnslink/\239\191\189'],
    //...
  ]
}

it would be also okay to get the entries at utf-8 encoded or binary data.

What do you see instead?

{
  err: null,
  data: [
    //...
    [ 'dnslink=/dnslink/bücher' ],
    [ 'dnslink=/dnslink/cool.foo..foo/bar' ],
    [ 'dnslink=/dnslink/domain.com©' ],
    [ 'dnslink=/dnslink/domain.com�' ],
    //...
    [ 'dnslink=/dnslink/пÑ\x80езиденÑ\x82.Ñ\x80Ñ\x84' ],
    [ 'dnslink=/dnslink/æ\x97¥æ\x9C¬èª\x9E.jp' ],
    [ 'dnslink=/dnslink/�'],
    //...
  ]
}

Additional information

I am aware it affects resolveTxt, but it likely also affects other parts of the dns system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dnsIssues and PRs related to the dns subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions