简体   繁体   中英

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

I am wondering 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM