Does Go cache DNS lookups?

后端 未结 2 2002
[愿得一人]
[愿得一人] 2021-02-20 15:59

I am building a test crawler and wanted to know if Go (golang) caches DNS queries. I don\'t see anything about caching in the dnsclient. This seems like an important thing to ad

2条回答
  •  一整个雨季
    2021-02-20 16:23

    The Go resolver does not do any in-process caching. While it would be possible to roll your own, your best bet is probably to run a system-wide DNS cache on each machine. (My favourite being dnsmasq.)

提交回复
热议问题