Skip to content

It doesn't work with IPv6 DNS servers #23

@sjakub

Description

@sjakub

Hi.

I cannot get it to work with IPv6 DNS servers.
Is this supported? I am using current master.

When I set only v6 DNS servers in my resolv.conf, the demo app refused to work:

$ ./dns show-hints
ZONE "."
        (1) [2001:4860:4860::8888]:53
$ ./dns send-query -q google.ca
querying 2001:4860:4860::8888 for google.ca IN AAAA
dns: (send_query:9433) dns_so_query: Address family not supported by protocol (97)

It works just fine with IPv4 DNS:

$ ./dns show-hints
ZONE "."
        (1) [8.8.8.8]:53
$ ./dns send-query -q google.ca
querying 8.8.8.8 for google.ca IN AAAA
;; [HEADER]
;;    qid : 53039
;;     qr : RESPONSE(1)
;; opcode : QUERY(0)
;;     aa : NON-AUTHORITATIVE(0)
;;     tc : NOT-TRUNCATED(0)
;;     rd : RECURSION-DESIRED(1)
;;     ra : RECURSION-ALLOWED(1)
;;  rcode : NOERROR(0)

;; [QUESTION:1]
;google.ca. IN AAAA

;; [ANSWER:1]
google.ca. 294 IN AAAA 2607:f8b0:400b:80e::2003

I also got it working in my application, by adding the DNS server name to hints with dns_hints_insert(),
and using dns_res_submit() and dns_res_check(). It works if I provide IPv4 DNS address,
but always returns 0 addresses when IPv6 DNS server is used.

I can also see that it creates an AF_INET socket in both cases, but only tries to call 'connect' when IPv4 DNS server is used.

Am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions