Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
net: lookupStaticHost caches for too long for Docker #13340
What kinds of names are in the /etc/hosts file in Docker? Do they look like fully-qualified names? It would be nice to avoid stat'ing the /etc/hosts file for all the regular DNS lookups. But if we had some way to tell, from looking at the name, that it was likely to come from /etc/hosts, we could make the lookup more aggressive about noticing changed /etc/hosts in that case.
The hostnames could be arbitrary, so I don't think you could tell from just looking at the hostname.
stat'ing the host file on every DNS lookup seems pretty expensive. But if we stat'ed the /etc/hosts file, say, every 5 or 10 seconds, that would be a big improvement over waiting 5 minutes.