brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.53k stars 2.27k forks source link

DNS cache doesn't get cleared #34547

Open andrewvaca opened 9 months ago

andrewvaca commented 9 months ago

Description

Hi, I can't easily clear internal DNS cache. There is a button in brave://net-internals/#dns that says "Clear host cache" and it works as far as the search field above. But the DNS remains cached somewhere inside browser, because domains are apparently cached even I clear this cache and the sites are loading from wrong IP.

As developer I'm often switching between two hosting services for one domain and the issue is sort of annoying. I know I should use different domain / subdomain for this, but in some specific cases it is not possible for me.

Steps to Reproduce

  1. Have two hosting services with different IPs for one domain (for example one production and one localhost, but issue is same regardless on exact IPs)
  2. Load website on domain example.com (using registrator's DNS - just default IP for the domain)
  3. Change DNS using hosts file to second IP address (for example "127.0.0.1 example.com")
  4. Flush system DNS cache and make sure it's active in terminal (for example "ping example.com")
  5. Go to URL brave://net-internals/?#dns and hit "Clear host cache" button
  6. Refresh URL example.com or open new tab with URL example.com

Actual result:

The sites from example.com are loaded from original IP, thus the DNS result is cached somewhere

Expected result:

The sites should load from localhost.

Reproduces how often:

I've managed to reproduce this issue every time.

Brave version (brave://version info)

Brave 1.60.118 Chromium: 119.0.6045.163 (Official build) (arm64) Verze b0599b790dbdfe28428202afe2b54758a044ccfc Operační systém macOS Verze 14.1.1 (sestava 23B81)

Other Additional Information:

The "DNS lookup" on brave://net-internals/?#dns shows correct IP even though sites are loaded from wrong IP. Only way I was able to clear the cache is restart of the browser.

andrelec1 commented 5 months ago

same here !

gmbno commented 1 month ago

Same here, however the domain is correctly resolved in a private window / tab.

Egglestron commented 1 month ago

Same here, had to close all windows and relaunch Brave to clear it.