Skip to content

Commit

Permalink
Don't error when no search domains are configured
Browse files Browse the repository at this point in the history
  • Loading branch information
janeczku committed Jun 5, 2016
1 parent f28077c commit f0260cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"strings"
"time"

log "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
"github.com/miekg/dns"
)
Expand Down Expand Up @@ -90,10 +91,11 @@ func CheckConfig(config *Config) error {
return fmt.Errorf("'listen' cannot be empty")
}
if !config.NoRec && len(config.Nameservers) == 0 {
return fmt.Errorf("You need to specify some nameservers or disable recursion")
return fmt.Errorf("Recursion is enabled but no nameservers are configured")
}
if config.AppendDomain && len(config.SearchDomains) == 0 {
return fmt.Errorf("You need to specify some search domains")
config.AppendDomain = false
log.Warnf("Disabling search domain treatment as no search domains are configured")
}
if config.RCache < 0 {
return fmt.Errorf("'rcache' must be equal or greater than 0")
Expand Down

0 comments on commit f0260cb

Please # to comment.