månadsarkiv: oktober 2013

How to lead a computer astray on the world wide web

In other words: How to troll your friends’ computers

This is a guide on how you edit the host-file in order to map a domain to an ip-address.

When you type in a domain name, such as www.timflach.com, you are actually being redirected to an IP-address. Around the world there are important computers that know what IP-address is mapped to what domain name. These are called DNS servers. They are updated when a domain name gets moved and real autorities on where web sites are located.

But, before your browser travels out into the world to collect information from the DNS servers it actually asks someone else. Or rather, it looks in your host file.

The host file is located in c:\windows\system32\drivers\etc\hosts (on Unix, /etc/hosts) and can contain information on where domain names lead. In it you can add pairs of domain names <–> IP-adresses to say that if a user types a specific domain name, the browser should be redirected to a particular IP. For example you can add the IP to the domain minecraft.net.

Here is how you edit the host file!

Open the file. You might need to do so as an administrator. I found that the easiest way was to type

after you’ve opened Windows’ metro mode and then right click —> open as administrator.

You will now see a file that looks somewhat like this:

And here is where you can add your own customization. Write the line

save, visit the domain namne in your browser and see what happens.

When is this useful, except for trolling your little brother? Say, for example that you are located on a network where you can’t access certain domain names without typing the IP-address. Now you can create your own way around that!