Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I edit my host files to redirect to a html file saved locally when a request is made to a specific IP? I have a Linux Mint box (pretty much an ubuntu distro).

Road runner has an annoying DNS error page I get whenever I mistype a url. I thought it would be cool to have a custom page show up instead of that.

share|improve this question
road runner seems to be a supercomputer that uses linux or a linux variant, or it's a piece of software "roadRunner is a high performance cellular network simulation.", or it's an ISP. I see you mean the ISP.. and I suppose, its DNS servers. – barlop Mar 24 '11 at 1:11
You left out the cartoon character "Road Runner"! – A Clockwork Orange Mar 24 '11 at 1:16
up vote 1 down vote accepted

you can resolve the name locally, the IP does not matter. Set the right order in /etc/nsswitch.conf (to read files before DNS), and make it an alias in /etc/hosts to either localhost or your own nodename.

But - a locally saved page in the filesystem will not do, you will have to run a local web server, but it can have a global redirect, so the URL they send you to does not matter.

share|improve this answer

That would not be possible with a hosts file entry: you need to find the IP address that gets returned instead of the correct one (or a DNS error), redirect that with iptables back to your machine, and install a web server of some sort too in order to serve the page you actually want.

If you simply want rid of your ISP's DNS hijacking page rather than particularly wanting one of your own then you could switch to different DNS servers (unless your ISP blocks this). Google's public DNS cache doesn't hijack requests for non-existent names for instance, so you could use these ( and instead of your ISP's.

share|improve this answer
No, the page it sends you to is I could ping that and get the IP of it, then it would be possible right? – A Clockwork Orange Mar 24 '11 at 0:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.