LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 01-07-2013, 06:40 PM   #31
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35

Quote:
Originally Posted by TobiSGD View Post
127.0.0.1 is OK, as long as you also use the interface option.
It is also OK to use 127.0.0.1 in the resolv.conf file, works fine here.

Of course, if you want to connect with other machines on that port the port must be open.
If listen-address is used in dnsmasq.conf, then it restricts dnsmasq to listen only on that address/interface.

With

listen-address = 127.0.0.1

Other machines on the LAN cannot connect. This is what LeoPap has in his config.

To allow other LAN boxes to connect to dnsmasq, the options are (1) change the listen-address to the LAN IP, or (2) remove the listen-address line entirely -- in which case dnsmasq listens on ALL interfaces.

Either approach is viable. I opted for the former. In retrospect it may have been simpler to have said, "put a # at the beginning on the 'listen-address' line and restart dnsmasq."

Last edited by sleddog; 01-07-2013 at 06:44 PM.
 
Old 01-07-2013, 07:19 PM   #32
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,650
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Quote:
Originally Posted by sleddog View Post
If listen-address is used in dnsmasq.conf, then it restricts dnsmasq to listen only on that address/interface.

With

listen-address = 127.0.0.1

Other machines on the LAN cannot connect. This is what LeoPap has in his config.

To allow other LAN boxes to connect to dnsmasq, the options are (1) change the listen-address to the LAN IP, or (2) remove the listen-address line entirely -- in which case dnsmasq listens on ALL interfaces.

Either approach is viable. I opted for the former. In retrospect it may have been simpler to have said, "put a # at the beginning on the 'listen-address' line and restart dnsmasq."
Sorry, but wrong. Have a look at my config file posted earlier in the thread, it is working fine for me, connecting from different machines (Linux and Windows) to that server.

This is what the man-page of dnsmasq has to say about that:
Quote:
Both --interface and --listen-address options may be given, in which case the set of both interfaces and addresses is used. Note that if no --interface option is given, but --listen-address is, dnsmasq will not automatically listen on the loopback interface. To achieve this, its IP address, 127.0.0.1, must be explicitly given as a --listen-address option.
So, if you have the interface specified in the config file giving the value of 127.0.0.1 to the listen-address option is not only totally OK, but in this case enables wanted behavior.
 
Old 01-07-2013, 08:38 PM   #33
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
I did not see any use of --interface in the config file originally posted by LeoPap, only --listen-address.

Rereading I see he copied your config, including the --interface option:

Quote:
I am using your configuration! ( Except the interface=br0 i use interface=etho )
If "interface=etho" isn't simply a typo here on the board, perhaps it's the problem. Should be eth0.
 
Old 01-07-2013, 08:49 PM   #34
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,650
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Quote:
Originally Posted by sleddog View Post
I did not see any use of --interface in the config file originally posted by LeoPap, only --listen-address.

Rereading I see he copied your config, including the --interface option:



If "interface=etho" isn't simply a typo here on the board, perhaps it's the problem. Should be eth0.
Nice catch, this may be the problem, if the typo is also in the config file. Either this or the running firewall, I would assume.
 
Old 01-08-2013, 03:21 AM   #35
LeoPap
Member
 
Registered: Jan 2013
Distribution: Centos
Posts: 97
Blog Entries: 1

Original Poster
Rep: Reputation: 5
Thank you guys sooo much!
Finally the problem solved!! The solutions was to open port 53 on iptables!!

Thnako you very much for your help all this time. I really appreciate it!


Cheers,
Leo
 
Old 01-09-2013, 10:18 AM   #36
LeoPap
Member
 
Registered: Jan 2013
Distribution: Centos
Posts: 97
Blog Entries: 1

Original Poster
Rep: Reputation: 5
Hello guys,

After using the caching server for 2 days on my windows pc's, i have noticed that the speed of browsing didn't have a dramatically change...Maybe it is a bit better than it was previously but not what i was expected...

Is there anything else i can do in order to get faster browsing?
Also is there any way to see if the cache-size has been reduced??

Cheers,
Leo

Last edited by LeoPap; 01-09-2013 at 10:21 AM.
 
Old 01-09-2013, 12:18 PM   #37
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,650
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Browsing of course only becomes faster for things that are cached, for example if you visit a site that you have visited before. And of course, as unSpawn stated already, you restarting the machine or dnsmasq will clear the cache, so that is a no-go. I use it to speed up my different machines (a machine has not look up DNS info that I have already visited on a different machine), especially when network load is high, and you really can see the difference. I can't say anything about performance on single machines that are used on home networks without other machines interfering.
If you often visit the same sites with somewhat static content it may help to use a caching proxy server, like Polipo (again, not really data here for that with single machines on single used home networks), that gave me a serious speed up, again especially when network load is high.

Last edited by TobiSGD; 01-09-2013 at 12:20 PM.
 
Old 01-09-2013, 12:25 PM   #38
LeoPap
Member
 
Registered: Jan 2013
Distribution: Centos
Posts: 97
Blog Entries: 1

Original Poster
Rep: Reputation: 5
I check the log file of dnsmasq and here are the results.



[root@localhost ~]# cat /var/log/dnsmasq.log
Jan 3 09:10:09 dnsmasq[1601]: started, version 2.48 cachesize 1000
Jan 3 09:10:09 dnsmasq[1601]: compile time options: IPv6 GNU-getopt DBus no-I18 N DHCP TFTP
Jan 3 09:10:09 dnsmasq[1601]: cleared cache
Jan 3 09:10:09 dnsmasq[1601]: failed to read /etc/resolv.dnsmasq: No such file or directory
Jan 3 09:21:47 dnsmasq[1601]: exiting on receipt of SIGTERM
Jan 3 09:21:53 dnsmasq[1627]: started, version 2.48 cachesize 1000
Jan 3 09:21:53 dnsmasq[1627]: compile time options: IPv6 GNU-getopt DBus no-I18 N DHCP TFTP
Jan 3 09:21:53 dnsmasq[1627]: cleared cache
Jan 3 09:21:53 dnsmasq[1627]: failed to read /etc/resolv.dnsmasq: No such file or directory
Jan 3 09:22:09 dnsmasq[1627]: exiting on receipt of SIGTERM
Jan 3 09:22:09 dnsmasq[1653]: started, version 2.48 cachesize 1000
Jan 3 09:22:09 dnsmasq[1653]: compile time options: IPv6 GNU-getopt DBus no-I18 N DHCP TFTP
Jan 3 09:22:09 dnsmasq[1653]: cleared cache
Jan 3 09:22:09 dnsmasq[1653]: failed to read /etc/resolv.dnsmasq: No such file or directory
Jan 4 12:34:21 dnsmasq[1653]: exiting on receipt of SIGTERM
Jan 4 12:35:06 dnsmasq[1041]: started, version 2.48 cachesize 1000
Jan 4 12:35:06 dnsmasq[1041]: compile time options: IPv6 GNU-getopt DBus no-I18 N DHCP TFTP
Jan 4 12:35:06 dnsmasq[1041]: cleared cache
Jan 4 12:35:06 dnsmasq[1041]: failed to read /etc/resolv.dnsmasq: No such file or directory
Jan 7 08:33:25 dnsmasq[1041]: exiting on receipt of SIGTERM


[root@localhost ~]# cat /etc/resolv.dnsmasq
nameserver 8.8.8.8
nameserver 208.67.222.222


i can see that the daemon can't read the resolv.dnsmasq. Maybe this has affect my browsing speed.

But why? With the cat command i can see that the file exists!!

Last edited by LeoPap; 01-09-2013 at 12:27 PM.
 
Old 01-09-2013, 12:38 PM   #39
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,650
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Possibly a permission issue? I can't really say. But what I can see is that your dnsmasq is restarted at least once a day, which will clear the cache and render it more or less useless. It may be that this behavior is caused by the inability to read resolv.dnsmasq, but the real question is: When dnsmasq can't resolve DNS queries on your server because it can't access the file with the nameserver addresses, how can it possibly ever have worked?
 
Old 01-09-2013, 12:44 PM   #40
LeoPap
Member
 
Registered: Jan 2013
Distribution: Centos
Posts: 97
Blog Entries: 1

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by TobiSGD View Post
Possibly a permission issue? I can't really say. But what I can see is that your dnsmasq is restarted at least once a day, which will clear the cache and render it more or less useless. It may be that this behavior is caused by the inability to read resolv.dnsmasq, but the real question is: When dnsmasq can't resolve DNS queries on your server because it can't access the file with the nameserver addresses, how can it possibly ever have worked?

I really don't know.. I am too confused now! i have change the dns server at my windows pc ( i add the ip of the caching server ) and i had internet connection!! How can this be possible?

When i install dnsmasq, i also type these commands:
groupadd -r dnsmasq
useradd -r -g dnsmasq dnsmasq

How can i be sure that it is not a permission issue?

Also if you see the log file stops at 7 of January..Why i don't have any data from 8 and 9 of January??

Last edited by LeoPap; 01-09-2013 at 12:45 PM.
 
Old 01-09-2013, 01:14 PM   #41
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,650
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Good question. Do you get log entries when you manually restart dnsmasq?
 
Old 01-09-2013, 01:18 PM   #42
LeoPap
Member
 
Registered: Jan 2013
Distribution: Centos
Posts: 97
Blog Entries: 1

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by TobiSGD View Post
Good question. Do you get log entries when you manually restart dnsmasq?
i restart the dnsmasq manually, but still on the /var/log/dnsmasq.log the last log entry is on 7 January..

Also i reboot the server and still no entry on the log file...
 
Old 01-09-2013, 04:29 PM   #43
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,650
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
But you can use it from your client or doesn't it work? Also, do you still have the line about the log location in your config file?
 
Old 01-10-2013, 03:08 AM   #44
LeoPap
Member
 
Registered: Jan 2013
Distribution: Centos
Posts: 97
Blog Entries: 1

Original Poster
Rep: Reputation: 5
The client ( Windows PC) has as dns the ip of the caching server and they had internet connection!!

Here is the configuration:


[root@localhost ~]# cat /etc/dnsmasq.conf
interface=eth0
listen-address=127.0.0.1
port=53
bind-interfaces
user=dnsmasq
group=dnsmasq
pid-file=/var/run/dnsmasq.pid
domain-needed
bogus-priv
dns-forward-max=150
cache-size=10000
neg-ttl=600
resolv-file=/etc/resolv.dnsmasq
 
Old 01-10-2013, 08:15 AM   #45
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,650
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
You are missing the line
Code:
log-facility=/var/log/dnsmasq.log
(and I seem to have failed in copy and paste, this line is the last in my config file), this is why you don't have anything in your log file, dnsmasq is just not logging.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
new samba server create problem centos 5.5 64bits salimshahzad Linux - Newbie 2 02-07-2011 03:45 PM
i have server which has Linux version centos i want to create the image of the server dhirendrs Linux - Newbie 6 07-22-2010 09:20 PM
i have one server which install the Centos OS and i want to create the image dhirendrs Linux - Enterprise 3 07-22-2010 04:11 PM
LXer: Create Your Own Web Server With BIND And Apache On CentOS 5 LXer Syndicated Linux News 0 07-02-2008 04:11 PM


All times are GMT -5. The time now is 11:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration