[PR #73] [CLOSED] Add healthtest feature to dynamically add/remove DNS entries #405

Closed
opened 2026-03-13 14:51:27 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/abh/geodns/pull/73
Author: @abligh
Created: 8/17/2015
Status: Closed

Base: masterHead: healthtest


📝 Commits (4)

  • 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

📊 Changes

11 files changed (+1176 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 (+12 -3)
📝 serve_test.go (+4 -0)
📝 targeting.go (+5 -6)
📝 targeting_test.go (+5 -5)
📝 zone.go (+33 -2)
📝 zones.go (+40 -8)

📄 Description

This is an experimental feature to add/remove DNS entries depending on whether servers/services are up/down. Initially NTP testing and TCP port testing are supported.

This is an experimental lightly tested patch. It's based on top of the other 3 merge requests I have submitted recently, but is pretty easily separated.

From the commit message:

commit 049d4acdfd1b5941feb501ddb1353a27e464047d
Author: Alex Bligh <alex@alex.org.uk>
Date:   Mon Aug 17 15:32:26 2015 +0100

Add healthtest functionality to automatically exclude down hosts

Add a healthtest function activated by setting the 'test' attribute on a label.
When a test is specified, each RR within the label (A and AAAA only at this
stage) is polled regularly with a configurable test. Current configurable
tests are that a tcp port can be opened, or that an NTP response within a
given stratum range is achieved. RRs that fail the test will be excluded
from any results.

Health tests can be configured as follows:

     "test" :  {
         "type" : "ntp",
         "frequency" : 30,
         "retry_time" : 5,
         "retries" : 3,
         "timeout" : 5,
         "max_stratum" : "3"
      }

or

     "test" :  {
         "type" : "tcp",
         "frequency" : 30,
         "retry_time" : 5,
         "retries" : 3,
         "timeout" : 5,
     "port" : 80
      }

Attributes are as follows:

* type: specifies type of test (currently "ntp" or "tcp")

* frequency: specifies time in seconds between polls if the server is up

* retry_time: specifies time in seconds between polls if a poll fails

* retries: number of failed polls required to consider a server as down

* timeout: timeout on each of the polls

* max_stratum: (ntp only) maximum ntp stratum number for the poll
  to be considered successful

* port: (tcp only) tcp port number to connect to

Signed-off-by: Alex Bligh <alex@alex.org.uk>

🔄 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/73 **Author:** [@abligh](https://github.com/abligh) **Created:** 8/17/2015 **Status:** ❌ Closed **Base:** `master` ← **Head:** `healthtest` --- ### 📝 Commits (4) - [`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 ### 📊 Changes **11 files changed** (+1176 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` (+12 -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 This is an experimental feature to add/remove DNS entries depending on whether servers/services are up/down. Initially NTP testing and TCP port testing are supported. This is an experimental lightly tested patch. It's based on top of the other 3 merge requests I have submitted recently, but is pretty easily separated. From the commit message: ``` commit 049d4acdfd1b5941feb501ddb1353a27e464047d Author: Alex Bligh <alex@alex.org.uk> Date: Mon Aug 17 15:32:26 2015 +0100 Add healthtest functionality to automatically exclude down hosts Add a healthtest function activated by setting the 'test' attribute on a label. When a test is specified, each RR within the label (A and AAAA only at this stage) is polled regularly with a configurable test. Current configurable tests are that a tcp port can be opened, or that an NTP response within a given stratum range is achieved. RRs that fail the test will be excluded from any results. Health tests can be configured as follows: "test" : { "type" : "ntp", "frequency" : 30, "retry_time" : 5, "retries" : 3, "timeout" : 5, "max_stratum" : "3" } or "test" : { "type" : "tcp", "frequency" : 30, "retry_time" : 5, "retries" : 3, "timeout" : 5, "port" : 80 } Attributes are as follows: * type: specifies type of test (currently "ntp" or "tcp") * frequency: specifies time in seconds between polls if the server is up * retry_time: specifies time in seconds between polls if a poll fails * retries: number of failed polls required to consider a server as down * timeout: timeout on each of the polls * max_stratum: (ntp only) maximum ntp stratum number for the poll to be considered successful * port: (tcp only) tcp port number to connect to Signed-off-by: Alex Bligh <alex@alex.org.uk> ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-13 14:51:27 +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#405
No description provided.