Skip to content

DNS entry count and SRV records #1621

@chrisvanmeer

Description

@chrisvanmeer

Describe the feature request

I would like to be able to count the number of results I get from a DNS query. So let's say I have a CNAME and/or a SRV record that returns 5 results (DNS round robin). I would like Gatus to check and safeguard that there are at least 4 of these entries available.

See these DNS queries for clarification:

chris@mgmt ~ $ dig traefik.service.consul SRV

; <<>> DiG 9.18.39-0ubuntu0.24.04.3-Ubuntu <<>> traefik.service.consul SRV
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42865
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;traefik.service.consul. IN SRV

;; ANSWER SECTION:
traefik.service.consul. 0 IN SRV 1 1 8082 c0a81a6f.addr.mox.consul.
traefik.service.consul. 0 IN SRV 1 1 8082 c0a81a6e.addr.mox.consul.
traefik.service.consul. 0 IN SRV 1 1 8082 c0a81a70.addr.mox.consul.

;; Query time: 1 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Thu Apr 09 07:17:15 CEST 2026
;; MSG SIZE  rcvd: 251
chris@mgmt ~ $ dig consul.service.consul SRV

; <<>> DiG 9.18.39-0ubuntu0.24.04.3-Ubuntu <<>> consul.service.consul SRV
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24707
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;consul.service.consul.        IN SRV

;; ANSWER SECTION:
consul.service.consul. 0 IN SRV 1 1 8300 consul03.node.mox.consul.
consul.service.consul. 0 IN SRV 1 1 8300 consul01.node.mox.consul.
consul.service.consul. 0 IN SRV 1 1 8300 consul02.node.mox.consul.

;; Query time: 10 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Thu Apr 09 07:13:55 CEST 2026
;; MSG SIZE  rcvd: 250

In Gatus we then should be able to perform some sort of count of the returned results

endpoints:
  - name: example-dns-query
    url: "192.168.26.1"
    dns:
      query-name: "traefik.service.consul"
      query-type: "CNAME"
    conditions:
      - "[COUNT] >= 3"
endpoints:
  - name: example-dns-query
    url: "192.168.26.1"
    dns:
      query-name: "consul.service.consul"
      query-type: "SRV"
    conditions:
      - "[COUNT] >= 3"

Why do you personally want this feature to be implemented?

I am using Consul for service discovery on Nomad and want to monitor the amount of healthy instances that are active for the given service and validate that they are still healthy enough by using a threshold.

How long have you been using this project?

No response

Additional information

No response

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