Improved Speed for DNS
I've got an incredibly slow 56k modem-connection. If I already download and wish to visit a website, the search for the host takes so long, that it would not be found in time and so i don't get a connection.
Thinking about making my own DNS-server I was reminded of the /etc/hosts.
What's in there is looked up first before a DNS-server is asked for an IP.
So I did this:
I pinged all my favourites (and the debian servers of my /etc/apt/sources.list, also).
So I can see the IP numbers. (for example ping www.google.com)
I copied them all to my /etc/hosts (as su, otherwise it would not be saveable)
It looks like this:
IP Tab (or Space) Domain Domain (without www, in order for it to work without www.)
188.8.131.52 www.google.com google.com
184.108.40.206 www.mipooh.net mipooh.net
220.127.116.11 www.kanotix.com kanotix.com
18.104.22.168 www.knopper.net knopper.net
-> Simply all notations of a domain separated by space(s) or tab (you can use fakes too).
Now if I type one of my favourite websites I am connected immediately. The searching for the host is not necessary for all my listed domains. And if I have new favourites I just add them to /etc/hosts.
And for this, I found a simple way to add new URLs:
// I just ping the website as su,
$ su -
# ping www.anysite.dom
PING (123.456.78.9 anysite.dom
// stop it by ctrl+c if I see the IP.
// Then I type:
# echo 123.456.78.9 www.anysite.dom anysite.dom >> /etc/hosts
// (IP and hostname are fakes here)
// and by linux-magic this is appended as the last line in my /etc/hosts file.
Good results for very little effort.