Is it possible for a WebExtension to override the IP address of a server, or to modify/intercept DNS requests or override the DNS cache? I'm trying to code a WebExtension that provides browsers with the same functionality as cURL's --resolve
.
Specifically, to:
- connect to a different IP than the one published in DNS
- add entries for particular non-existent domains that the user wishes to resolve as if they existed (e.g. patching in access to an OpenNIC site via a WebExtension could be more robust and far less disruptive to the broader system/network than playing whack-a-mole with volunteer-run DNS servers that never stay online for more than a few years)
- "resolve" particular entries while the relevant DNS server is offline
- cache or pin DNS entries in a software-defined way in preparation for a known upcoming DNS poisoning attack
In short: to simulate the effect of a hosts
file, but without administrative privileges / messing with the rest of the system.