PCLinuxOS-Forums
News: ...FLASH!!! ...New PCLinuxOS Testing board now open. Register today! Be an active contributor to the PCLinuxOS future! ... Read all about it now, on THIS forum!!!..
 
*
Welcome, Guest. Please login or register. May 27, 2012, 09:45:05 AM


Login with username, password and session length


Pages: [1] 2   Go Down
  Print  
Author Topic: DNS cache - dnsmasq  (Read 2116 times)
janasx1
Full Member
***
Offline Offline

Posts: 111



« on: February 03, 2011, 08:50:09 PM »

I setup dns caching using dnsmasq.
dnsmasq is a non-persistent DNS cache.

1. Install dnsmasq from synaptic package manager
2. set following parameters in /etc/dnsmasq.conf
resolv-file=/etc/resolv.dnsmasq.conf
listen-address=127.0.0.1
3. create file /etc/resolv.dnsmasq.conf with following lines. (feel free to use your ISP's dns here. I am using openDNS)
nameserver 208.67.222.222
nameserver 208.67.220.220
4. restart dnsmasq
/etc/init.d/dnsmasq restart
5. add 127.0.0.1 as the first dns in your network config.

To clear the cache, restart dnsmasq (#4 above)

To test config, execute below command twice and the time taken for the second request should be much less.
dig www.pclinuxos.com
Logged

HP Pavilion notebook DV6400, AMD Turion TL-64, 2GB RAM, broadcom BCM4312, nvidia Geforce Go 6150
muungwana
Hero Member
*****
Offline Offline

Posts: 5403


« Reply #1 on: February 03, 2011, 09:41:47 PM »


5. add 127.0.0.1 as the first dns in your network config.


above line need to be expanded and explained.
Logged

.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..
janasx1
Full Member
***
Offline Offline

Posts: 111



« Reply #2 on: February 06, 2011, 01:00:24 AM »

Sure.
Here are the steps for #5.

1. open PCLinuxOS Control Center
2. click on network & internet
3. click on network center
4. click on wired/wireless depending on the way you connect
5. If wireless, select the ssid you are connected to
6. click on configure
7. un-check "get DNS servers from dhcp"
8. type in 127.0.0.1 in dns server 1 field.
9. click ok and then quit
Logged

HP Pavilion notebook DV6400, AMD Turion TL-64, 2GB RAM, broadcom BCM4312, nvidia Geforce Go 6150
janasx1
Full Member
***
Offline Offline

Posts: 111



« Reply #3 on: February 06, 2011, 02:06:12 PM »

Here is the explanation.

All the dns requests will be routed to 127.0.0.1 which is dnsmasq. dnsmasq will try to lookup first in the cache and if the cache does not have it, it will look up against opendns servers and puts it in the cache. subsequent requests to dnsmasq will come from the local cache.
Logged

HP Pavilion notebook DV6400, AMD Turion TL-64, 2GB RAM, broadcom BCM4312, nvidia Geforce Go 6150
sling-shot
Hero Member
*****
Offline Offline

Posts: 638


Satyameva Jayate | Truth Alone Triumphs.


« Reply #4 on: July 04, 2011, 11:20:11 PM »

Request one more clarification:

What is the validity of the cache? Will it be stored on a reboot or cleared? Or will it only be cleared manually?

I shutdown my desktop everyday.

-SS.
Logged

===>>> The scariest thing about Jurassic Park was that the control systems were Unix.

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/SAMSUNG 17" Syncmaster/Creative SBS370 2.1/PCLinuxOS2010/KDE4
HP Mini 110-3027TU Netbook | Nokia E6-00
janasx1
Full Member
***
Offline Offline

Posts: 111



« Reply #5 on: July 11, 2011, 05:30:50 PM »

I believe its in memory and will get cleared on reboot.
Logged

HP Pavilion notebook DV6400, AMD Turion TL-64, 2GB RAM, broadcom BCM4312, nvidia Geforce Go 6150
AndrzejL
PCLinuxOS Tester
Super Villain
*******
Offline Offline

Posts: 11990


Registered Linux User #490933


WWW
« Reply #6 on: December 09, 2011, 03:02:21 PM »

As a warning I might add that if You use Internet Connection Sharing and You use Bind - do not use dnsmasq - I tried and it removes bind during installation.

Regards.

Andy
Logged

janasx1
Full Member
***
Offline Offline

Posts: 111



« Reply #7 on: December 09, 2011, 11:19:13 PM »

Hi Andy,
I have another more recent post in tips and tricks about using bind for dns caching.
Thanks
Logged

HP Pavilion notebook DV6400, AMD Turion TL-64, 2GB RAM, broadcom BCM4312, nvidia Geforce Go 6150
YouCanToo
PCLinuxOS Tester
Hero Member
*******
Offline Offline

Posts: 4251


Location: Lebanon, OR., USA


WWW
« Reply #8 on: December 09, 2011, 11:31:58 PM »

I setup dns caching using dnsmasq.
dnsmasq is a non-persistent DNS cache.

1. Install dnsmasq from synaptic package manager
2. set following parameters in /etc/dnsmasq.conf
resolv-file=/etc/resolv.dnsmasq.conf
listen-address=127.0.0.1
3. create file /etc/resolv.dnsmasq.conf with following lines. (feel free to use your ISP's dns here. I am using openDNS)
nameserver 208.67.222.222
nameserver 208.67.220.220
4. restart dnsmasq
/etc/init.d/dnsmasq restart
5. add 127.0.0.1 as the first dns in your network config.

To clear the cache, restart dnsmasq (#4 above)

To test config, execute below command twice and the time taken for the second request should be much less.
dig www.pclinuxos.com



How about doing a small write up about this in the howto section of the pclinuxoshelp knowledge base? (http://pclinuxoshelp.com)
Logged





Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!
AndrzejL
PCLinuxOS Tester
Super Villain
*******
Offline Offline

Posts: 11990


Registered Linux User #490933


WWW
« Reply #9 on: December 10, 2011, 04:05:02 PM »

Hi Andy,
I have another more recent post in tips and tricks about using bind for dns caching.
Thanks

I cannot find it. Plus I am not saying that Your way is bad with dnsmasq all I am saying - if You use bind - don't use dnsmasq Wink.

Andy
Logged

AndrzejL
PCLinuxOS Tester
Super Villain
*******
Offline Offline

Posts: 11990


Registered Linux User #490933


WWW
« Reply #10 on: December 10, 2011, 04:32:40 PM »

Ah nevermind. I have found it Smiley. It was in the wrong section - not in Tips and Tricks but in Networking.

Here is the link to the bind HOWTO. http://www.pclinuxos.com/forum/index.php/topic,99575.0.html

Will check it out.
Logged

janasx1
Full Member
***
Offline Offline

Posts: 111



« Reply #11 on: December 13, 2011, 07:51:20 PM »

I would love to add this to the knowledge base.
How do I register to login?
Thanks
Logged

HP Pavilion notebook DV6400, AMD Turion TL-64, 2GB RAM, broadcom BCM4312, nvidia Geforce Go 6150
YouCanToo
PCLinuxOS Tester
Hero Member
*******
Offline Offline

Posts: 4251


Location: Lebanon, OR., USA


WWW
« Reply #12 on: December 13, 2011, 08:10:42 PM »

I would love to add this to the knowledge base.
How do I register to login?
Thanks

Send me a PM with your username, real name and a working email address. I will setup your account and an email will be sent with a temp password to use, Once you log into the knowledge base you can change your password to what ever you want it to be. Make sure to tell me it is for the knowledge base

YouCanToo
Logged





Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!
janasx1
Full Member
***
Offline Offline

Posts: 111



« Reply #13 on: December 15, 2011, 11:24:23 PM »

Thanks YouCanToo.
I now have login to the knowledge base.
I am having trouble adding a page to HOWTO category. If I edit it adds to the category page itself.
Thanks
Logged

HP Pavilion notebook DV6400, AMD Turion TL-64, 2GB RAM, broadcom BCM4312, nvidia Geforce Go 6150
YouCanToo
PCLinuxOS Tester
Hero Member
*******
Offline Offline

Posts: 4251


Location: Lebanon, OR., USA


WWW
« Reply #14 on: December 16, 2011, 12:22:08 AM »

Thanks YouCanToo.
I now have login to the knowledge base.
I am having trouble adding a page to HOWTO category. If I edit it adds to the category page itself.
Thanks

Log in and goto the HowTo page on the left side in the search box type in the name that you want to name your page and click search.

Example: I typed in "My new page and pressed search. This is the results.

Search results

    Content pages
    Multimedia
    Help and Project pages
    Everything
    Advanced

    Showing below 1 result starting with #1.

Create the page "My new page" on this wiki!

    Live CD faq
    === My CD is in my drive, but when I turn my computer on, nothing different happens === === Why does my computer freeze when trying to boot the live CD? ===
    8 KB (1,470 words) - 22:17, 24 June 2011


Now I clicked on My new page that is in red. The results are this will become your new page (file)  You can than click on "edit" at the top to add your information to the page. You can only edit a page when you are logged into the system.

 MAKE SURE that you add the following to the very bottom of your page on a line by itself

[[Category:HowTo]]

When you are finished with your page make sure that you save it.  Now your new page will automatically be added to the HowTo section in alphabetical order according to the first word of the page name.

In my example the listing would be listed under the letter M since my page name was "My new page"


If you have questions please ask. If you can't figure it out let me know the name you want and I will add it and than you can edit the file as needed.

Logged





Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM