Good use of the Hosts file

The other day they finally opened up port 22 on one of my workstations at school. We also got assigned a static IP on the school network which means I can now log into that box from anywhere in the world. One thing we did not apply was an entry in the school DNS so that we could actually call the machine by its name. It’s not like we really need one as there is no webserver running on that box. All I really need is remote access to initiate tests and check the results. So in effect poor evangelion (named after the excellent anime show) must be referred to as a number.

I don’t know about you, but I can’t remember IP addresses no matter how often I use them. My brain just will not recall long number sequences for some reason. So after looking it up for the fiftieth time, I finally remembered what the hosts file is for. So I promptly placed an entry in /etc/hosts/ and now wherever I take my laptop I can just type in ssh evangelion to get to my test machine at school.

This was probably the first time I actually touched the hosts file on that machine since I installed Kubuntu a while ago. Never really needed to use it before.

My windows box at home is an entirely different case. There my hosts file has a long list of known malware peddling domains being redirected to 127.0.0.1. You can get a decent list from mvps, or allow Spybot to generate one for you automatically (it’s one of the options in advanced mode).

Anyways, this is one of the first good, practical uses I found for that damn file other than locking out spyware, and doing pranks on people by redirecting everything to some vile pr0n sites. :P

This entry was posted in Uncategorized. Bookmark the permalink.



One Response to Good use of the Hosts file

  1. Robin Stamer CANADA Mozilla Linux says:

    man ssh_config

    Just as effective, but is able to also store special configuration options per host. Example:

        Host Router-0
            HostName 10.0.0.1
            ForwardAgent Yes
    

    Then just “ssh Router-0” (note: case-sensitive).

    Reply  |  Quote

Leave a Reply

Your email address will not be published. Required fields are marked *