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

Ability to disable "Special Use Domain Name" blocking #1618

Merged
merged 12 commits into from
Dec 8, 2024
4 changes: 2 additions & 2 deletions config/sudn.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ type SUDN struct {
// upstream or custom DNS, which come before SUDN in the resolver chain.
// Thus defaulting to `true` and returning NXDOMAIN here should not conflict.
RFC6762AppendixG bool `yaml:"rfc6762-appendixG" default:"true"`
Enable bool `yaml:"enable" default:"true"`
}

// IsEnabled implements `config.Configurable`.
func (c *SUDN) IsEnabled() bool {
// The Special Use RFCs are always active
return true
return c.Enable
}

// LogConfig implements `config.Configurable`.
Expand Down
14 changes: 13 additions & 1 deletion config/sudn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,21 @@ var _ = Describe("SUDNConfig", func() {
})

Describe("IsEnabled", func() {
It("is true", func() {
It("should be true by default", func() {
Expect(cfg.IsEnabled()).Should(BeTrue())
})

When("enabled", func() {
It("should be true", func() {
Expect(cfg.IsEnabled()).Should(BeTrue())
})
})

When("disabled", func() {
It("should be false", func() {
Expect(cfg.IsEnabled()).Should(BeFalse())
})
})
})

Describe("LogConfig", func() {
Expand Down
1 change: 1 addition & 0 deletions docs/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ specialUseDomains:
# optional: block recomended private TLDs
# default: true
rfc6762-appendixG: true
enable: true

# optional: configure extended client subnet (ECS) support
ecs:
Expand Down
Loading
Loading