Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS queries fail for type AAAA #1470

Closed
shore opened this issue Dec 4, 2015 · 3 comments
Closed

DNS queries fail for type AAAA #1470

shore opened this issue Dec 4, 2015 · 3 comments

Comments

@shore
Copy link
Collaborator

shore commented Dec 4, 2015

Hi,
I'm trying to use consul as a primary resolver and I see SRV records resolve correctly, but I can't get AAAA queries to work. Cluster membership looks like this:

# consul members
Node            Address           Status  Type    Build  Protocol  DC
consul001       [fd00::500]:8301  alive   server  0.5.2  2         dc4-sea
consul003       [fd00::502]:8301  alive   server  0.5.2  2         dc4-sea
consul002       [fd00::501]:8301  alive   server  0.5.2  2         dc4-sea
prometheus      [fd00::237]:8301  alive   client  0.5.2  2         dc4-sea

On the client:

$ cat /etc/resolv.conf
nameserver fd00::500

Testing with dig:
Fetch SRV record:

$ dig devCluster.prometheus.service.consul SRV

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.37.rc1.el6_7.4 <<>> devCluster.prometheus.service.consul SRV
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6353
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; QUESTION SECTION:
;devCluster.prometheus.service.consul. IN SRV

;; ANSWER SECTION:
devCluster.prometheus.service.consul. 0 IN SRV  1 1 9090 prometheus.node.dc4-sea.consul.

;; ADDITIONAL SECTION:
prometheus.node.dc4-sea.consul. 0 IN    AAAA    fd00::237

;; Query time: 2 msec
;; SERVER: fd00::500#53(fd00::500)
;; WHEN: Fri Dec  4 17:10:58 2015
;; MSG SIZE  rcvd: 198

Fetch that AAAA record:

$ dig prometheus.node.dc4-sea.consul AAAA

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.37.rc1.el6_7.4 <<>> prometheus.node.dc4-sea.consul AAAA
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10878
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;prometheus.node.dc4-sea.consul.        IN      AAAA

;; Query time: 0 msec
;; SERVER: fd00::500#53(fd00::500)
;; WHEN: Fri Dec  4 17:11:16 2015
;; MSG SIZE  rcvd: 48

Try again with type ANY:

$ dig prometheus.node.dc4-sea.consul ANY

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.37.rc1.el6_7.4 <<>> prometheus.node.dc4-sea.consul ANY
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31766
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;prometheus.node.dc4-sea.consul.        IN      ANY

;; ANSWER SECTION:
prometheus.node.dc4-sea.consul. 0 IN    AAAA    fd00::237

;; Query time: 1 msec
;; SERVER: fd00::500#53(fd00::500)
;; WHEN: Fri Dec  4 17:11:20 2015
;; MSG SIZE  rcvd: 106

DNS logs on the server (fd00::500):

2015/12/04 17:11:23 [DEBUG] dns: request for {devCluster.prometheus.service.consul. 33 1} (1.648168ms)
2015/12/04 17:11:41 [DEBUG] dns: request for {prometheus.node.dc4-sea.consul. 28 1} (83.155µs)
2015/12/04 17:11:45 [DEBUG] dns: request for {prometheus.node.dc4-sea.consul. 255 1} (977.941µs)

I can work around this in my own code (though stdlib doesn't support ANY queries), but 3rd-party tools fail too:

$ curl -gsS 'http://prometheus.node.dc4-sea.consul:9090/status'
curl: (6) Couldn't resolve host 'prometheus.node.dc4-sea.consul'
$ curl -gsS 'http://fd00::237:9090/status' | head
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Prometheus Time Series Collection and Processing Server</title>
    <script src="/static/vendor/js/jquery.min.js"></script>
    <script src="/static/vendor/bootstrap-3.3.1/js/bootstrap.min.js"></script>

    <link type="text/css" rel="stylesheet" href="/static/vendor/bootstrap-3.3.1/css/bootstrap.min.css">
    <link type="text/css" rel="stylesheet" href="/static/css/prometheus.css">

I see that the docs for the DNS interface only demonstrate ANY and SRV records. Is consul intentionally not handling AAAA records? Am I missing something obvious?

@slackpad
Copy link
Contributor

slackpad commented Dec 4, 2015

Hi @shore I think this will be fixed in Consul 0.6, which should be released next week - #1222. We've got a release candidate build if you want to give that a shot on one of your agents - https://releases.hashicorp.com/consul/0.6.0-rc2/ - it will interoperate with 0.5.2 servers.

@slackpad
Copy link
Contributor

slackpad commented Dec 4, 2015

I'll close this out as a dup for now but please do re-open if you see any issues with the newer Consul version.

@slackpad slackpad closed this as completed Dec 4, 2015
@shore
Copy link
Collaborator Author

shore commented Dec 4, 2015

0.6.0-rc2 fixes my issue, I don't know how I missed #1222 when scanning issues and PRs yesterday. Thanks for the pointer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants