I have written a script đồ sộ add websites đồ sộ the hostfile at certain times of the day. For example, it can block Youtube from 8pm - 10pm. It works well, however the changes aren't reflected in Chrome. This has something đồ sộ vì thế with internal DNS caching in Chrome and seemingly cannot be flushed without going into Chrome's settings or restarting the browser.
Is there any way đồ sộ flush this cache from the terminal?
asked Oct 11, 2020 at 3:54
DaraJDaraJ
1461 gold badge3 silver badges11 bronze badges
1
Cutting out the network and then restarting it works (thanks đồ sộ this answer); on Ubuntu I'm using nmcli. I wrote this as a script called "social-media-break" and run rẩy it with an argument for sleep lượt thích "5m" or "15m". It relies on the existence of these hosts.socialmediaallow and hosts.normal files, where the "normal" one sends various social truyền thông sites đồ sộ 127.0.0.1.
This is quick and dirty, requires root.
#!/bin/bash
sudo -v
sudo cp /etc/hosts.socialmediaallow /etc/hosts
sleep $1
sudo cp /etc/hosts.normal /etc/hosts
nmcli networking off && nmcli networking on
answered Nov 28, 2023 at 19:56
2
Have you ever tried:
Open a new tab>Type the url in the tìm kiếm box: chrome://net-internals/#dns Hit the “Clear host cache” button.
You may need đồ sộ flush out socket pools too: Open a new tab and type the following in tìm kiếm box: chrome://net-internals/#sockets Click on the “Flush socket pools“:
answered Oct 14, 2020 at 8:31
1
You must log in đồ sộ answer this question.
Not the answer you're looking for? Browse other questions tagged
.
Not the answer you're looking for? Browse other questions tagged
.