[Dnsmasq-discuss] Re: dyndns-style addition of names

2007-04-02 Thread Stefan Monnier
>> - dbus may be able to allow a different user to send
>> a "ClearCache"  method call to dnsmasq.
>> 
> I'm not sure about this, but it looks like it may be possible by adding
> suitable XML to   /etc/dbus-1/system.d/dnsmasq.conf

> Assuming that permissions are a soluble problem, it might make sense to
> add a DBus method to add host records directly. The main problem with
> this is that they would be lost over a dnsmasq restart, unless there's
> another daemon somewhere which stores the information and re-sends to
> dnsmasq when it starts up and send the "Up" signal.

> This is a general problem: I'd quite like to provide a DBus method to
> add MAC address/name/IP records for DHCP, but that breaks for the same
> reason.

> Maybe a solution would be to add code to make such configuration
> persistent by storing it in a file. That would mean that server
> addresses/domains and possibly DNS host records and DHCP host records
> could be set by DBus, and would remain until explicitly cleared.

> Does that sound sensible?

Could be.  My dnsmasq deamon is on a tiny home-router running OpenWRT and
DBus support doesn't seem to be included.


Stefan




Re: [Dnsmasq-discuss] dyndns-style addition of names

2007-04-02 Thread Simon Kelley
Aaron D. Brooks wrote:

> - dbus may be able to allow a different user to send
>   a "ClearCache"  method call to dnsmasq.
> 
I'm not sure about this, but it looks like it may be possible by adding
suitable XML to   /etc/dbus-1/system.d/dnsmasq.conf

Assuming that permissions are a soluble problem, it might make sense to
add a DBus method to add host records directly. The main problem with
this is that they would be lost over a dnsmasq restart, unless there's
another daemon somewhere which stores the information and re-sends to
dnsmasq when it starts up and send the "Up" signal.

This is a general problem: I'd quite like to provide a DBus method to
add MAC address/name/IP records for DHCP, but that breaks for the same
reason.

Maybe a solution would be to add code to make such configuration
persistent by storing it in a file. That would mean that server
addresses/domains and possibly DNS host records and DHCP host records
could be set by DBus, and would remain until explicitly cleared.

Does that sound sensible?


Cheers,

Simon.





Re: [Dnsmasq-discuss] dnsmasq-2.39 release candidate for testing.

2007-04-02 Thread xerces8

> Allow absolute paths for TFTP transfers even when
> --tftp-root is set, as long as the path matches the root,
> so /var/ftp/myfile is OK which tftp-root=/var/ftp.
> Thanks for Thomas Mizzi for the patch.

Small typo :
"... is OK _with_ tftp-root=/var/ftp."
not "which"

David





Re: [Dnsmasq-discuss] dnsmasq-2.39 release candidate for testing.

2007-04-02 Thread Simon Kelley
xerces8 wrote:
> Where is the changelog ?
> 
>

Good point.

There's a CHANGELOG file in the tarball. For convenience, I've appended
the 2.38->2.39rc1 changes here.


Cheers,

Simon.


Apply patch from Mike Baker/OpenWRT to ensure that names
like "localhost." in /etc/hosts with trailing period
are treated as fully-qualified.

Tolerate and ignore spaces around commas in the
configuration file in all circumstances. Note that this
may change the meaning of a few existing config files, for
instance
txt-record=mydomain.com, string
would have a leading space in the string before, and now
will not. To get the old behaviour back, use quotes:
txt-record=mydomain.com," string"

/a is no longer a valid escape in quoted strings.

Added symbolic DHCP option names. Instead of
dhcp-option = 3, 1.2.3.4
it is now possible to do
dhcp-option = option:router, 1.2.3.4
To see the list of known DHCP options, use the
command "dnsmasq --help dhcp"
Thanks to Luigi Rizzo for a patch and good work on this.

Overhauled the log code so that logging is asynchronous;
dnsmasq no longer blocks waiting for the syslog() library
call. This is important on systems where syslog
is being used to log over the network (and therefore doing
DNS lookups) and syslog is using dnsmasq as its DNS
server. Having dnsmasq block awaiting syslog under
such circumstances can lead to syslog and dnsmasq
deadlocking. Paul Chambers found and diagnosed
this trap for the unwary. He also did much testing of
the solution.

Added --log-max flag to tune log-queue length.

--log-facility can now take a file-name instead of a
facility name. When this is done, dnsmasq logs to the
file and not via syslog. (Failures early in startup,
whilst reading configuration, will still go to syslog,
and syslog is used as a log-of-last-resort if the file
cannot be written.)

Added --log-dhcp flag. Suggestion from Carlos Carvalho.

Made BINDIR, MANDIR and LOCALEDIR independently
over-rideable in the makefile. Suggestion from Thomas
Klausner.

Added 127.0.0.0/8 and 169.254.0.0/16 to the address
ranges affected by --bogus-priv. Thanks to  Paul
Chambers for the patch.

Fixed failure of TFTP server with --listen-address. Thanks
to William Dinkel for the bug report.

Added --dhcp-circuitid and --dhcp-remoteid for RFC3046
relay agent data matching.

Added --dhcp-subscrid for RFC3993 subscriber-id relay
agent data matching.

Correctly garbage-collect connections when upstream
servers go away as a result of DBus transactions.

Allow absolute paths for TFTP transfers even when
--tftp-root is set, as long as the path matches the root,
so /var/ftp/myfile is OK which tftp-root=/var/ftp.
Thanks for Thomas Mizzi for the patch.




Re: [Dnsmasq-discuss] dnsmasq-2.39 release candidate for testing.

2007-04-02 Thread xerces8
Where is the changelog ?

Regards,
David

-Original Message-
From: Simon Kelley 
To: dnsmasq discussion list 
Date: Sun, 01 Apr 2007 19:39:32 +0100
Subject: [Dnsmasq-discuss] dnsmasq-2.39 release candidate for testing.

> rc1 is now available from:
> 
> http://www.thekelleys.org.uk/dnsmasq/release-candidates/dnsmasq-2.39rc1.tar.gz
> 
> Please test it out and let me know the results.
> 
> 
> Cheers,
> 
> Simon.
> 
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss





Re: [Dnsmasq-discuss] dyndns-style addition of names

2007-04-02 Thread Aaron D. Brooks
On Sun, Apr 01, 2007 at 04:32:02PM -0400, Stefan Monnier wrote:
> I have a remote machine whose IP address is not static.  I could use
> a dyndns.org service, but I'd much rather keep this less public.
> 
> That machine can and does connect via SSH to my dnsmasq home server
> fairly regularly.  What would you recommend I do to add an entry in my local
> home domain?
> 
> Let's say I want to call my remote machine "remote.home" in my home network.
> Currently I add/update a " remote.home" line in my /etc/hosts
> file and then kill -HUP the "dnsmasq" ?
> 
> The problem with that option is that the remote host does not ssh-in as
> root, so it can't change /etc/hosts nor kill-hup the dnsmasq daemon.  So I
> have to use a cron daemon to poll some other file and do that.
> 
> Does anyone have a better idea?  Ideally I'd want dnsmasq to poll an
> etc/hosts-like file directly.

Stefan,

dnsmasq can read additional hosts files with the (--)addn-hosts
option. It seems reasonable that you could specify a file which is
writable by the SSH capable user and stick only the hostname of the
remote system in there. This setup makes a great ssh pushbutton, i.e.
a passwordless private key with a hard coded command in the authorized
keys file:

command="/home/my_user/bin/ddns-host.sh",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty
 <... public key ...>

Where ddns-host.sh could be:

#!/bin/bash

myhostname=mobile.foo.tld

# May yield IPv6 form of IPv4 address
myip=${SSH_CLIENT%% *}

# dnsmasq serves IPv6 addresses so you shouldn't actually need to
# do this.
myip=${myip##:::}

echo "$myip $myhostname" > /path/to/addn-host.file

###
# HUP or dbus here...
###

Now, to get dnsmasq to reload you could use one of several mechanisms:

- Another SSH pushbutton key for my_user to run which is in root's
  authorized_keys file and only can do a "killall -HUP dnsmasq"

- A sudo entry which allows my_user to do a "killall -HUP dnsmasq"

- You could make a hupdnsmasq set-uid executable (ew...)

- dbus may be able to allow a different user to send
  a "ClearCache"  method call to dnsmasq.

Someone no doubt has a better idea than the above but they're what
I could think of at the moment.

-Aaron

--
Aaron Brooks, Senior Software Engineer
SiCortex, Inc. [ http://sicortex.com ]
Teraflops from Milliwatts






[Dnsmasq-discuss] dyndns-style addition of names

2007-04-02 Thread Stefan Monnier

I have a remote machine whose IP address is not static.  I could use
a dyndns.org service, but I'd much rather keep this less public.

That machine can and does connect via SSH to my dnsmasq home server
fairly regularly.  What would you recommend I do to add an entry in my local
home domain?

Let's say I want to call my remote machine "remote.home" in my home network.
Currently I add/update a " remote.home" line in my /etc/hosts
file and then kill -HUP the "dnsmasq" ?

The problem with that option is that the remote host does not ssh-in as
root, so it can't change /etc/hosts nor kill-hup the dnsmasq daemon.  So I
have to use a cron daemon to poll some other file and do that.

Does anyone have a better idea?  Ideally I'd want dnsmasq to poll an
etc/hosts-like file directly.


Stefan