22.12.09

Setting DNS server in Linux

Hello everyone,

recently I replaced my DSL modem with a router. After replacement I noticed, that my Internet connection (Firefox/Thunderbird) became very slowly - I needed more than 10 seconds to open a page. Firefox was showing "Looking up " message all the time.

My first idea was to check the DNS server. In the /etc/resolv.conf file I could see that my router is acting as DNS server:
nameserver 192.168.1.1

I checked options to replace that address with the the DNS servers of my provider (Hansenet/Alice, Germany) and found following solution:
1) copy file /etc/dhcp3/dhclient.conf into dhclient.conf.original - to make a backup copy of the file;
2) open dhclient.conf with any editor and make following changes:

* uncomment line "prepend domain-name-servers..." and enter there - comma-separated - IP adresses of the desired DNS servers;
* in the line "request subnet-mask,broadcast-address..." remove part "domain-name-servers" - in this way you prevent DHC client from retrieving the DNS name from the router.

After restarting the networking (/etc/init.d/networking restart) and bringing up your interface you must get you Internet connection at normal speed.

Any comments are welcome!

Andrey

P.S. Important to notice, that I DO NOT use resolvconf-package.

4 comments:

Anonymous said...

Easily I assent to but I think the post should secure more info then it has.

Andrey said...

Sorry, I didn't understand you...

Anonymous said...

Genial post and this enter helped me alot in my college assignement. Say thank you you on your information.

Anonymous said...

Good dispatch and this post helped me alot in my college assignement. Gratefulness you for your information.