diff --git a/hosts.go b/hosts.go index 2af165c..87ebb01 100644 --- a/hosts.go +++ b/hosts.go @@ -20,7 +20,7 @@ func NewHosts(hs HostsSettings, rs RedisSettings) Hosts { fileHosts := &FileHosts{hs.HostsFile} var rc *redis.Client - if rs.Enable { + if hs.RedisEnable { rc = &redis.Client{Addr: rs.Addr(), Db: rs.DB, Password: rs.Password} } else { rc = nil diff --git a/settings.go b/settings.go index 1481146..4c5b153 100644 --- a/settings.go +++ b/settings.go @@ -36,7 +36,6 @@ type DNSServerSettings struct { } type RedisSettings struct { - Enable bool Host string Port int DB int @@ -58,10 +57,11 @@ type CacheSettings struct { } type HostsSettings struct { - Enable bool - HostsFile string `toml:"host-file"` - RedisKey string `toml:"redis-key"` - TTL uint32 `toml:"ttl"` + Enable bool + HostsFile string `toml:"host-file"` + RedisEnable bool `toml:"redis-enable"` + RedisKey string `toml:"redis-key"` + TTL uint32 `toml:"ttl"` } func init() {