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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
20 changes: 19 additions & 1 deletion config/sudn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,27 @@ 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() {
cfg := SUDN{
Enable: true,
}
Expect(cfg.IsEnabled()).Should(BeTrue())
})
})

When("disabled", func() {
It("should be false", func() {
cfg := SUDN{
Enable: false,
}
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