Prevent Chrome from caching a site's DNS records

后端 未结 3 2168
温柔的废话
温柔的废话 2021-02-20 17:42

Chrome caches DNS records and tends to ignore changes to the hosts file after it has successfully connected to my site (barring a restart). With DNS pre-fetching enabled, it is

3条回答
  •  广开言路
    2021-02-20 17:53

    In my case I often switch from my dev web server and a production server using custom hosts files, in order to clear all the dns cached info from chrome I use this procedure, and it works instantly in the same tab where I need to load the updated web site address:

    1. Copy and paste this url in chrome: chrome://net-internals/#dns
    2. Click on the "Clear Host Cache" button and also click on the small black arrow in the top right corner of the window, click "Clear cache" and "Flusk Sockets", and the new address will be loaded istantly.

提交回复
热议问题