summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-09-23 13:11:35 +0700
committerShulhan <ms@kilabit.info>2023-09-23 13:11:35 +0700
commitbbc3ebac7e823ca7bf9874d223c71f3270258c24 (patch)
tree7dc2f47eca6c65c5c0ff390c0a81c265cce1159c
parent631dd476ac3fd7d7c8045b6e6ca59b63955bca67 (diff)
downloadrescached-bbc3ebac7e823ca7bf9874d223c71f3270258c24.tar.xz
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.
-rw-r--r--rescached.go9
1 files changed, 0 insertions, 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