Skip to content

Instantly share code, notes, and snippets.

@slackpad
Last active March 4, 2016 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slackpad/8e1ef5a5141fdbd3ec60 to your computer and use it in GitHub Desktop.
Save slackpad/8e1ef5a5141fdbd3ec60 to your computer and use it in GitHub Desktop.
dig @127.0.0.1 -p8600 nope.node.consul

; <<>> DiG 9.8.3-P1 <<>> @127.0.0.1 -p8600 nope.node.consul
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 14084
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;nope.node.consul.              IN      A

;; AUTHORITY SECTION:
consul.                 0       IN      SOA     ns.consul. postmaster.consul. 1457123698 3600 600 86400 0

;; Query time: 0 msec
;; SERVER: 127.0.0.1#8600(127.0.0.1)
;; WHEN: Fri Mar  4 12:34:58 2016
;; MSG SIZE  rcvd: 102
dig @127.0.0.1 -p8600 nope.service.consul

; <<>> DiG 9.8.3-P1 <<>> @127.0.0.1 -p8600 nope.service.consul
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 48588
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;nope.service.consul.           IN      A

;; AUTHORITY SECTION:
consul.                 0       IN      SOA     ns.consul. postmaster.consul. 1457123735 3600 600 86400 0

;; Query time: 0 msec
;; SERVER: 127.0.0.1#8600(127.0.0.1)
;; WHEN: Fri Mar  4 12:35:35 2016
;; MSG SIZE  rcvd: 105
dig @127.0.0.1 -p8600 nope.query.consul

; <<>> DiG 9.8.3-P1 <<>> @127.0.0.1 -p8600 nope.query.consul
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 3587
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;nope.query.consul.             IN      A

;; AUTHORITY SECTION:
consul.                 0       IN      SOA     ns.consul. postmaster.consul. 1457123753 3600 600 86400 0

;; Query time: 0 msec
;; SERVER: 127.0.0.1#8600(127.0.0.1)
;; WHEN: Fri Mar  4 12:35:53 2016
;; MSG SIZE  rcvd: 103
curl -X POST -d \
'{
 "Name": "",
 "Template": {
   "Type": "name_prefix_match"
 },
 "Service": {
   "Service": "${name.full}",
   "Failover": {
     "NearestN": 3
   }
 },
 "DNS": {
   "TTL": "10s"
 }
}' localhost:8500/v1/query
dig @127.0.0.1 -p8600 nope.query.consul

; <<>> DiG 9.8.3-P1 <<>> @127.0.0.1 -p8600 nope.query.consul
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 24536
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;nope.query.consul.             IN      A

;; AUTHORITY SECTION:
consul.                 0       IN      SOA     ns.consul. postmaster.consul. 1457123840 3600 600 86400 0

;; Query time: 0 msec
;; SERVER: 127.0.0.1#8600(127.0.0.1)
;; WHEN: Fri Mar  4 12:37:20 2016
;; MSG SIZE  rcvd: 103
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment