I am wondering 开发者_StackOverflow中文版if there is a way to programmatically clear a single DNS cache entry in both Windows and Linux. Or if there is some other way to force a gethostbyname call to not use the local cache.
Clearing the entire cache would not be ideal.
Thanks.
I vaguely recall making the request to the cache with the AUTHORITATIVE bit set.
You can't do that with gethostbyname(): you have to call the resolver on UDP port 53.
精彩评论