Re: [Dnsmasq-discuss] basic host name problem

2010-01-26 Thread Adam Hardy

dnsmasq.to.pee...@spamgourmet.com on 26/01/10 08:20, wrote:

On Mon, Jan 25, 2010 at 12:20 PM, Adam Hardy
 wrote:

[leases work but]

There must be something missing from my dnsmasq config because I see now
that
any attempt to use the host names of dhcp clients from the gateway
server fail
with " unknown host ...". I'm on debian stable if that makes any
difference


Richard wrote:

Sounds like your gateway is not using dnsmasq for lookups.  dnsmasq
tells dhcp clients to use its services, but the gateway you will have
to manually configure in /etc/resolv.conf to send requests to the
local dnsmasq process.


Adam wrote:

I've got 127.0.0.1 in my /etc/hosts


Richard's zeroed in on the problem I reckon.

Here's the Debian Way  to fix it, imho.

Did you apt-get install resolvconf? In debian that takes care of the
dnsmasq usage.

And you can add

  dns-nameservers 8.8.8.8 4.2.2.4

to your interfaces file for the interface connecting to the internet on
the router for when dnsmasq doesn't have it in cache. (Use:
dns-nameservers 192.168.0.2 8.8.8.8 4.2.2.4 for the lan setting).

When you've done that, apt-get install dnsutils and see what dig
google.com or such on the router tells you is the IP of the nameserver you
are using. It should be 127.0.0.1.


Hi PJ
sounds interesting - but the external interface gets has a DHCP ip address so I 
can't put that into /etc/networking/interfaces. Or are you talking just 
temporarily for debugging purposes?




Re: [Dnsmasq-discuss] basic host name problem

2010-01-26 Thread Adam Hardy

richardvo...@gmail.com on 26/01/10 14:23, wrote:

On Tue, Jan 26, 2010 at 3:19 AM, Adam Hardy  wrote:

richardvo...@gmail.com on 26/01/10 01:56, wrote:

There must be something missing from my dnsmasq config because I see
now that any attempt to use the host names of dhcp clients from the gateway
server fail with "unknown host ...". I'm on debian stable if that makes any
difference


Sounds like your gateway is not using dnsmasq for lookups.  dnsmasq
tells dhcp clients to use its services, but the gateway you will have
to manually configure in /etc/resolv.conf to send requests to the
local dnsmasq process.


adam@isengard:~$ cat /etc/resolv.conf
domain isengard.localdomain
search isengard.localdomain
nameserver 127.0.0.1
nameserver 194.74.65.68


Perhaps your resolv.conf is causing requests for
client.isengard.localdomain while dnsmasq made an entry for
client.localdomain


Here's a query log:

Jan 26 14:49:13 localhost dnsmasq[31068]: reading /etc/resolv.conf
Jan 26 14:49:13 localhost dnsmasq[31068]: using nameserver 194.74.65.68#53
Jan 26 14:49:13 localhost dnsmasq[31068]: ignoring nameserver 127.0.0.1 - local
interface
Jan 26 14:49:13 localhost dnsmasq[31068]: using local addresses only for domain
localdomain
Jan 26 14:49:13 localhost dnsmasq[31068]: query[A] MFD8FDC7.isengard.localdomain
from 127.0.0.1
Jan 26 14:49:13 localhost dnsmasq[31068]: config MFD8FDC7.isengard.localdomain
is NXDOMAIN-IPv4

So it's exactly what you predicted - but I've read thro the whole config and
can't see what I need to change. Here's my dnsmasq.conf again:

domain-needed
bogus-priv
filterwin2k
server=/localdomain/127.0.0.1
local=/localdomain/
expand-hosts
domain=localdomain
dhcp-range=192.168.0.3,192.168.0.254
dhcp-option=option:router,192.168.0.2
dhcp-option=option:mtu,1500

I think that resolv.conf is wrong - should domain=localdomain and not
isengard.localdomain?

resolv.conf is being constantly rewritten by dhclient3 which is doing obtaining
an ip address via dhcp for the external NIC. I can see now that I had

supersede domain-name "isengard.localdomain"

in the dhclient3.conf - doh! So that was it.

Thanks for your help,
regards
Adam




Re: [Dnsmasq-discuss] basic host name problem

2010-01-26 Thread dnsmasq . to . peejay
> On Mon, Jan 25, 2010 at 12:20 PM, Adam Hardy
>  wrote:
[leases work but]
>> There must be something missing from my dnsmasq config because I see now
>> that
>> any attempt to use the host names of dhcp clients from the gateway
>> server fail
>> with " unknown host ...". I'm on debian stable if that makes any
>> difference

Richard wrote:
> Sounds like your gateway is not using dnsmasq for lookups.  dnsmasq
> tells dhcp clients to use its services, but the gateway you will have
> to manually configure in /etc/resolv.conf to send requests to the
> local dnsmasq process.

Adam wrote:
>> I've got 127.0.0.1 in my /etc/hosts

Richard's zeroed in on the problem I reckon.

Here's the Debian Way  to fix it, imho.

Did you apt-get install resolvconf? In debian that takes care of the
dnsmasq usage.

And you can add

  dns-nameservers 8.8.8.8 4.2.2.4

to your interfaces file for the interface connecting to the internet on
the router for when dnsmasq doesn't have it in cache. (Use:
dns-nameservers 192.168.0.2 8.8.8.8 4.2.2.4 for the lan setting).

When you've done that, apt-get install dnsutils and see what dig
google.com or such on the router tells you is the IP of the nameserver you
are using. It should be 127.0.0.1.

Pawan Jaitly







Re: [Dnsmasq-discuss] basic host name problem

2010-01-26 Thread richardvo...@gmail.com
On Tue, Jan 26, 2010 at 3:19 AM, Adam Hardy  wrote:
> richardvo...@gmail.com on 26/01/10 01:56, wrote:
>
> There must be something missing from my dnsmasq config because I see
> now that
> any attempt to use the host names of dhcp clients from the gateway
> server fail
> with " unknown host ...". I'm on debian stable if that makes any
> difference

 Sounds like your gateway is not using dnsmasq for lookups.  dnsmasq
 tells dhcp clients to use its services, but the gateway you will have
 to manually configure in /etc/resolv.conf to send requests to the
 local dnsmasq process.
>>>
>>> I mistakenly included the /etc/hosts file instead of the /etc/resolv.conf
>>> file
>>> which would have been far more informative re this problem.
>>>
>>> It looks like this:
>>>
>>> adam@isengard:~$ cat /etc/resolv.conf
>>> domain isengard.localdomain
>>> search isengard.localdomain
>>> nameserver 127.0.0.1
>>> nameserver 194.74.65.68
>>
>> Run netstat whilst dnsmasq is stopped, to see if any other dns-capable
>> daemon could be binding port 53 and preventing dnsmasq from receiving
>> the queries.
>
>
> This is what I see:

Looks good.  I think you will have to turn on query logging in dnsmasq
and see if it receives any queries.

Perhaps your resolv.conf is causing requests for
client.isengard.localdomain while dnsmasq made an entry for
client.localdomain

>
> Interesting ports on localhost (127.0.0.1):
> Not shown: 1703 closed ports
> PORT     STATE SERVICE
> 21/tcp   open  ftp
> 22/tcp   open  ssh
> 25/tcp   open  smtp
> 111/tcp  open  rpcbind
> 139/tcp  open  netbios-ssn
> 445/tcp  open  microsoft-ds
> 631/tcp  open  ipp
> 3306/tcp open  mysql
> 3689/tcp open  rendezvous
> 7634/tcp open  hddtemp
> 8009/tcp open  ajp13
> 8080/tcp open  http-proxy
>
> Read data files from: /usr/share/nmap
> Nmap done: 1 IP address (1 host up) scanned in 0.148 seconds
> adam@isengard:~$  netstat -an |grep -i "listen "
> tcp        0      0 0.0.0.0:11301           0.0.0.0:*               LISTEN
> tcp        0      0 127.0.0.1:6600          0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:3689            0.0.0.0:*               LISTEN
> tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:33005           0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN
> tcp        0      0 127.0.0.1:7634          0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
> tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN
> tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN
> tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN
> tcp6       0      0 :::8009                 :::*                    LISTEN
> tcp6       0      0 :::139                  :::*                    LISTEN
> tcp6       0      0 :::8080                 :::*                    LISTEN
> tcp6       0      0 :::22                   :::*                    LISTEN
> tcp6       0      0 ::1:631                 :::*                    LISTEN
> tcp6       0      0 :::445                  :::*                    LISTEN
>
>


Re: [Dnsmasq-discuss] basic host name problem

2010-01-26 Thread Adam Hardy

richardvo...@gmail.com on 26/01/10 01:56, wrote:

There must be something missing from my dnsmasq config because I see now that
any attempt to use the host names of dhcp clients from the gateway server fail
with " unknown host ...". I'm on debian stable if that makes any difference

Sounds like your gateway is not using dnsmasq for lookups.  dnsmasq
tells dhcp clients to use its services, but the gateway you will have
to manually configure in /etc/resolv.conf to send requests to the
local dnsmasq process.

I mistakenly included the /etc/hosts file instead of the /etc/resolv.conf file
which would have been far more informative re this problem.

It looks like this:

adam@isengard:~$ cat /etc/resolv.conf
domain isengard.localdomain
search isengard.localdomain
nameserver 127.0.0.1
nameserver 194.74.65.68


Run netstat whilst dnsmasq is stopped, to see if any other dns-capable
daemon could be binding port 53 and preventing dnsmasq from receiving
the queries.



This is what I see:

Interesting ports on localhost (127.0.0.1):
Not shown: 1703 closed ports
PORT STATE SERVICE
21/tcp   open  ftp
22/tcp   open  ssh
25/tcp   open  smtp
111/tcp  open  rpcbind
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
631/tcp  open  ipp
3306/tcp open  mysql
3689/tcp open  rendezvous
7634/tcp open  hddtemp
8009/tcp open  ajp13
8080/tcp open  http-proxy

Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 0.148 seconds
adam@isengard:~$  netstat -an |grep -i "listen "
tcp0  0 0.0.0.0:11301   0.0.0.0:*   LISTEN
tcp0  0 127.0.0.1:6600  0.0.0.0:*   LISTEN
tcp0  0 0.0.0.0:36890.0.0.0:*   LISTEN
tcp0  0 127.0.0.1:3306  0.0.0.0:*   LISTEN
tcp0  0 0.0.0.0:33005   0.0.0.0:*   LISTEN
tcp0  0 0.0.0.0:111 0.0.0.0:*   LISTEN
tcp0  0 127.0.0.1:7634  0.0.0.0:*   LISTEN
tcp0  0 0.0.0.0:21  0.0.0.0:*   LISTEN
tcp0  0 0.0.0.0:22  0.0.0.0:*   LISTEN
tcp0  0 127.0.0.1:631   0.0.0.0:*   LISTEN
tcp0  0 127.0.0.1:250.0.0.0:*   LISTEN
tcp6   0  0 127.0.0.1:8005  :::*LISTEN
tcp6   0  0 :::8009 :::*LISTEN
tcp6   0  0 :::139  :::*LISTEN
tcp6   0  0 :::8080 :::*LISTEN
tcp6   0  0 :::22   :::*LISTEN
tcp6   0  0 ::1:631 :::*LISTEN
tcp6   0  0 :::445  :::*LISTEN




Re: [Dnsmasq-discuss] Logfile rotation

2010-01-26 Thread Don Muller
That worked. Thanks all for the help.

Don

-Original Message-
From: richardvo...@gmail.com [mailto:richardvo...@gmail.com] 
Sent: Monday, January 25, 2010 1:59 AM
To: Don Muller
Cc: Santiago Zarate; dnsmasq-discuss@lists.thekelleys.org.uk
Subject: Re: [Dnsmasq-discuss] Logfile rotation

On Sun, Jan 24, 2010 at 11:33 PM, Don Muller  wrote:
> logrotate does not exist on the NAS. I can write a script to perform it on 
> dnsmasq if someone would tell me what happens when dnsmasq receives SIGUSR2.

I strongly suspect that it closes its current file (by filehandle) and
opens again the same name.  Therefore you should relink (move/rename)
the existing logfile beforehand so that the open attempt finds no
existing file and creates a new one.

On POSIX, you can rename a file which is in use and all open
filehandles stay valid (writing the same file but with a different
name from before, IOs to a file don't involve the name except for open
itself).

>
> -Original Message-
> From: santiago.j.zar...@gmail.com [mailto:santiago.j.zar...@gmail.com] On 
> Behalf Of Santiago Zarate
> Sent: Sunday, January 24, 2010 11:16 PM
> To: Don Muller
> Cc: dnsmasq-discuss@lists.thekelleys.org.uk
> Subject: Re: [Dnsmasq-discuss] Logfile rotation
>
> I would suggest you to use logrotate directly...:
> http://linux.die.net/man/8/logrotate
>
> 2010/1/24 Don Muller :
>> Hi,
>>
>>
>>
>> I just started using dnsmasq on my home network. It is running on my QNAP
>> TS-509 NAS and it works great!
>>
>>
>>
>> I have a question about log rotation. I know I have to send a SIGUSR2 to
>> perform a log rotation but what exactly happens? How does it work? I enabled
>> logging and there are messages being logged. I issued a “kill -12 pid of
>> dnsmasq” but nothing happened. IS the log supposed to be renamed and a new
>> one created using the same name specified in the conf file? I’ve read the
>> man page but I still can’ figure out how it works and what is supposed to
>> happen.
>>
>>
>>
>> Thanks
>>
>> Don
>>
>> ___
>> Dnsmasq-discuss mailing list
>> Dnsmasq-discuss@lists.thekelleys.org.uk
>> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>>
>>
>
>
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>




Re: [Dnsmasq-discuss] basic host name problem

2010-01-26 Thread richardvo...@gmail.com
On Mon, Jan 25, 2010 at 6:29 PM, Adam Hardy  wrote:
> richardvo...@gmail.com on 25/01/10 21:14, wrote:
>> On Mon, Jan 25, 2010 at 12:20 PM, Adam Hardy
>>  wrote:
>>> I've got a gateway server running dnsmasq for dhcp on my LAN and I've got a
>>> couple of problems with the host names of the dhcp clients.
>>>
>>> The first is a Belkin print server which picks up its ip address and passes 
>>> thro
>>> its hostname MFD8FDC7. This appears in dnsmasq.leases - so I should be able 
>>> to
>>> communicate with it now, right?
>>>
>>> There must be something missing from my dnsmasq config because I see now 
>>> that
>>> any attempt to use the host names of dhcp clients from the gateway server 
>>> fail
>>> with " unknown host ...". I'm on debian stable if that makes any difference
>>
>> Sounds like your gateway is not using dnsmasq for lookups.  dnsmasq
>> tells dhcp clients to use its services, but the gateway you will have
>> to manually configure in /etc/resolv.conf to send requests to the
>> local dnsmasq process.
>
> I mistakenly included the /etc/hosts file instead of the /etc/resolv.conf file
> which would have been far more informative re this problem.
>
> It looks like this:
>
> adam@isengard:~$ cat /etc/resolv.conf
> domain isengard.localdomain
> search isengard.localdomain
> nameserver 127.0.0.1
> nameserver 194.74.65.68
>
> Do I need to add more in there?

That should do it.

Run netstat whilst dnsmasq is stopped, to see if any other dns-capable
daemon could be binding port 53 and preventing dnsmasq from receiving
the queries.

>
> Regards
> Adam
>
>
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>



Re: [Dnsmasq-discuss] basic host name problem

2010-01-26 Thread Adam Hardy

richardvo...@gmail.com on 25/01/10 21:14, wrote:

On Mon, Jan 25, 2010 at 12:20 PM, Adam Hardy
 wrote:

I've got a gateway server running dnsmasq for dhcp on my LAN and I've got a
couple of problems with the host names of the dhcp clients.

The first is a Belkin print server which picks up its ip address and passes thro
its hostname MFD8FDC7. This appears in dnsmasq.leases - so I should be able to
communicate with it now, right?

There must be something missing from my dnsmasq config because I see now that
any attempt to use the host names of dhcp clients from the gateway server fail
with " unknown host ...". I'm on debian stable if that makes any difference


Sounds like your gateway is not using dnsmasq for lookups.  dnsmasq
tells dhcp clients to use its services, but the gateway you will have
to manually configure in /etc/resolv.conf to send requests to the
local dnsmasq process.


I mistakenly included the /etc/hosts file instead of the /etc/resolv.conf file
which would have been far more informative re this problem.

It looks like this:

adam@isengard:~$ cat /etc/resolv.conf
domain isengard.localdomain
search isengard.localdomain
nameserver 127.0.0.1
nameserver 194.74.65.68

Do I need to add more in there?

Regards
Adam