On Wed, Jun 7, 2023 at 5:13 AM Kishan Pandey <pandey.k.kis...@gmail.com> wrote: > > My application is using gorm to connect to the database FQDN. If I am making > changes to DNS record for the FQDN , the application needs to be restarted to > take the DNS change. I think it is making the DNS query only at the > application start time but not afterward. > > I would like to know how does golang manages the DNS changes. I looked at > gorm issue and found one comment stating that gorm does not manage DNS cache > its usage system default.
The Go standard library doesn't cache DNS lookups. If you look up a name twice, it will generate two different DNS requests, or two different calls to getaddrinfo. That is, Go expects to be contacting a caching resolver. Of course, a Go program can do a DNS lookup and cache the results outside of the standard library. So while I don't know what problem you are encountering, it doesn't seem likely to be in the Go standard library. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcX0s5y8pC0WmiQgtbMMp0rSoD13L1nuvc_1-aSTOwPxng%40mail.gmail.com.