0

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.

2
  • 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, 2011 at 1:11
  • You left out the cartoon character "Road Runner"! Mar 24, 2011 at 1:16

2 Answers 2

1

you can resolve the name dnssearch.rr.com 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.

0

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 (8.8.8.8 and 8.8.4.4) instead of your ISP's.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .