[PR #79] [CLOSED] Add a health RR #267

Closed
opened 2026-03-01 17:24:53 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/abh/geodns/pull/79
Author: @abligh
Created: 9/2/2015
Status: Closed

Base: masterHead: health-rr


📝 Commits (5)

  • cc09d9d Add delay to test start.
  • d763f74 Remove minimum TTL for NS records
  • 901652a Add 'closest' flag
  • b268006 Add healthtest functionality to automatically exclude down hosts
  • 8143ab0 Add a health RR

📊 Changes

11 files changed (+1215 additions, -33 deletions)

View changed files

📝 config.go (+10 -0)
📝 geoip.go (+26 -1)
healthtest.go (+405 -0)
healthtesters.go (+561 -0)
📝 picker.go (+75 -8)
📝 serve.go (+51 -3)
📝 serve_test.go (+4 -0)
📝 targeting.go (+5 -6)
📝 targeting_test.go (+5 -5)
📝 zone.go (+33 -2)
📝 zones.go (+40 -8)

📄 Description

Add a RR which returns the health status of a record, for debugging purposes. This returns in JSON format the health record of all the records associated with a label if a health test is running.

Example follows.

$ dig -p 10053 TXT _health.foo.example2.com @127.0.0.1

; <<>> DiG 9.8.3-P1 <<>> -p 10053 TXT _health.foo.example2.com @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59545
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;_health.foo.example2.com.  IN      TXT

;; ANSWER SECTION:
_health.foo.example2.com. 1 IN      TXT     "{\"A\":{\"192.168.1.2\":false,\"192.168.1.3\":false,\"192.168.1.4\":false},\"AAAA\":{\"fd06:c1d3:e902:202:a5ff:fecd:13a6:a\":false,\"fd06:c1d3:e902::2\":false,\"fd06:c1d3:e902::4\":false}}"

;; Query time: 1 msec
;; SERVER: 127.0.0.1#10053(127.0.0.1)
;; WHEN: Wed Sep  2 19:24:01 2015
;; MSG SIZE  rcvd: 251

Decoding that JSON:

{
   "A" : {
      "192.168.1.4" : false,
      "192.168.1.3" : false,
      "192.168.1.2" : false
   },
   "AAAA" : {
      "fd06:c1d3:e902:202:a5ff:fecd:13a6:a" : false,
      "fd06:c1d3:e902::4" : false,
      "fd06:c1d3:e902::2" : false
   }
}

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/abh/geodns/pull/79 **Author:** [@abligh](https://github.com/abligh) **Created:** 9/2/2015 **Status:** ❌ Closed **Base:** `master` ← **Head:** `health-rr` --- ### 📝 Commits (5) - [`cc09d9d`](https://github.com/abh/geodns/commit/cc09d9d9917f030ed6f58df602fb03667e5e73b1) Add delay to test start. - [`d763f74`](https://github.com/abh/geodns/commit/d763f7429ec8abcf527cbb1a461624d9b5aa74b8) Remove minimum TTL for NS records - [`901652a`](https://github.com/abh/geodns/commit/901652ab76d5e03c69dc5756561913e8528ec1b3) Add 'closest' flag - [`b268006`](https://github.com/abh/geodns/commit/b26800627639c9f8c485119a797fd2ec3c303872) Add healthtest functionality to automatically exclude down hosts - [`8143ab0`](https://github.com/abh/geodns/commit/8143ab0caac75b0cb91b2ed1cc81c393dc645b8b) Add a health RR ### 📊 Changes **11 files changed** (+1215 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `config.go` (+10 -0) 📝 `geoip.go` (+26 -1) ➕ `healthtest.go` (+405 -0) ➕ `healthtesters.go` (+561 -0) 📝 `picker.go` (+75 -8) 📝 `serve.go` (+51 -3) 📝 `serve_test.go` (+4 -0) 📝 `targeting.go` (+5 -6) 📝 `targeting_test.go` (+5 -5) 📝 `zone.go` (+33 -2) 📝 `zones.go` (+40 -8) </details> ### 📄 Description Add a RR which returns the health status of a record, for debugging purposes. This returns in JSON format the health record of all the records associated with a label if a health test is running. Example follows. ``` $ dig -p 10053 TXT _health.foo.example2.com @127.0.0.1 ; <<>> DiG 9.8.3-P1 <<>> -p 10053 TXT _health.foo.example2.com @127.0.0.1 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59545 ;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; WARNING: recursion requested but not available ;; QUESTION SECTION: ;_health.foo.example2.com. IN TXT ;; ANSWER SECTION: _health.foo.example2.com. 1 IN TXT "{\"A\":{\"192.168.1.2\":false,\"192.168.1.3\":false,\"192.168.1.4\":false},\"AAAA\":{\"fd06:c1d3:e902:202:a5ff:fecd:13a6:a\":false,\"fd06:c1d3:e902::2\":false,\"fd06:c1d3:e902::4\":false}}" ;; Query time: 1 msec ;; SERVER: 127.0.0.1#10053(127.0.0.1) ;; WHEN: Wed Sep 2 19:24:01 2015 ;; MSG SIZE rcvd: 251 ``` Decoding that JSON: ``` { "A" : { "192.168.1.4" : false, "192.168.1.3" : false, "192.168.1.2" : false }, "AAAA" : { "fd06:c1d3:e902:202:a5ff:fecd:13a6:a" : false, "fd06:c1d3:e902::4" : false, "fd06:c1d3:e902::2" : false } } ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 17:24:53 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/geodns#267
No description provided.