开发者

Programatically clear a single DNS cache entry in Windows and Linux in C++

开发者 https://www.devze.com 2023-01-23 12:24 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消