Intercept DNS request in a Chrome Extension? Intercept DNS request in a Chrome Extension? google-chrome google-chrome

Intercept DNS request in a Chrome Extension?


There's no mechanism to manipulate DNS requests/responses natively inside Chrome, not even via the upcoming WebRequest API.

Is there a reason that you need to test with exactly the same domain name? Setting up a dev environment on something like http://dev.example.com/ (or http://example.dev/ if you run your own DNS or have edited your hosts file) is a clean mechanism for producing the effect you want in a way that's functional with the APIs you have access to; writing an extension that gave you a button to toggle between the two domains with the push of a button would be trivial