From bbc3ebac7e823ca7bf9874d223c71f3270258c24 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sat, 23 Sep 2023 13:11:35 +0700 Subject: all: remove loading system hosts file Loading and caching system hosts file (for example, /etc/hosts in POSIX) will leaks internal hosts if the rescached server is open to public. The system hosts file are handled by nssswitch.conf "files" internally so no need to loading it. --- rescached.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/rescached.go b/rescached.go index 53281d5..3f9ceed 100644 --- a/rescached.go +++ b/rescached.go @@ -89,15 +89,6 @@ func (srv *Server) Start() (err error) { } } - hfile, err = dns.ParseHostsFile(dns.GetSystemHosts()) - if err != nil { - return err - } - err = srv.dns.Caches.InternalPopulateRecords(hfile.Records, hfile.Path) - if err != nil { - return err - } - for _, hb = range srv.env.HostBlockd { if !hb.IsEnabled { continue -- cgit v1.3