diff --git a/internal/home/clients.go b/internal/home/clients.go index 6d22bb19..882f5586 100644 --- a/internal/home/clients.go +++ b/internal/home/clients.go @@ -117,9 +117,7 @@ func (clients *clientsContainer) Init( } clients.dhcpServer = dhcpServer - if etcHosts != nil { - clients.etcHosts = etcHosts - } + clients.etcHosts = etcHosts clients.addFromConfig(objects) if !clients.testing { diff --git a/internal/home/home.go b/internal/home/home.go index a4c863de..62764e4e 100644 --- a/internal/home/home.go +++ b/internal/home/home.go @@ -201,8 +201,8 @@ func setupConfig(args options) { if !args.noEtcHosts { Context.etcHosts = &aghnet.EtcHostsContainer{} Context.etcHosts.Init("") - Context.clients.Init(config.Clients, Context.dhcpServer, Context.etcHosts) } + Context.clients.Init(config.Clients, Context.dhcpServer, Context.etcHosts) config.Clients = nil if (runtime.GOOS == "linux" || runtime.GOOS == "darwin") &&