[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] Add support for DNS TXT records

On 03/29/2011 12:52 PM, Michal Novotny wrote:
It would be great to:

1) add<user-class>  and<vendor-class>  tags inside<dhcp>  that allow
filtering according to user/vendor classes

Well, I didn't know this is supported by DNSMasq but it seems to be

Yes, I am using it. :)

        -4, --dhcp-mac=<network-id>,<MAC address>
               Map from a MAC address to a network-id tag. The MAC
address may include wildcards. For example
--dhcp-mac=3com,01:34:23:*:*:* will set the  tag  "3com"  for  any  host
               whose MAC address matches the pattern.


2) allow to specify<bootp>  inside those as well as inside<range>
or<host>  elements.

Right, there's bootp option:

It's already supported by libvirt.

3) add support for DHCP options besides bootp, with a tag like<option
force="yes|no" name="..." value="...">.

For example, my router's DHCP configuration would look like this:

   <range ...>
   <user-class prefix="iPXE">
     <bootp file="http://playground.usersys.redhat.com/pxe/boot.ipxe";>
   <bootp file="undionly.kpxe">

That's not a bad idea at all and I think it's worth it however
originally my patch was about DNS and not DHCP.

Yes, of course.

Thinking more about it, <range ...> could also be (optionally) placed inside <user-class> and <vendor-class> ("serve this range only to this user class or vendor class").

I have to admit that DNS
TXT record only patch was not the right thing to be implemented since I
should have implemented all the DNS records supported

Should you? I am not sure of that. Are they really so useful, except for CNAME (whose functionality dnsmasq more or less supports using A and PTR records) and maybe SRV? Remember that A and PTR records are added automatically by dnsmasq based on /etc/hosts.

Perhaps, you could implement (instead of tags for PTR, CNAME, etc.)

    <host ip="">

instead, which would write a file host1 host2 host3

and pass it to dnsmasq via --addn-hosts. But every feature should be added as a separate patch.

I tried following invocations of dnsmasq (I tried it on port 52 instead
not to mess up with my current networking):

first-term# dnsmasq --strict-order --bind-interfaces
--pid-file=/var/run/libvirt/network/default.pid --conf-file=
--except-interface lo --listen-address --dhcp-range,
--dhcp-lease-max=253 --dhcp-no-override --no-daemon -p 52
--txt-record="some name","some value"

second-term$ dig TXT some name @ -p 52
connection timed out; no servers could be reached

second-term$ dig TXT "some name" @ -p 52
some\032name.           0       IN      TXT     "some value"

This is just how dnsmasq prints the request. You can see with wireshark that the request is really for "some name". BTW, please test your patch with commas in the name. Those should be forbidden probably (not sure about the value).

So what do you think about this? Also, do you think we should implement
everything connected to DNSMasq mentioned there (i.e. both DNS and DHCP
stuff) in one commit, just few separate patches (e.g. one for DNS and
second for DHCP/BOOTP) ?

Many many separate patches.

BTW, regarding this particular series, you should update the XML schema, and add many many testcases. Do this for TXT, then you can start thinking about everything else.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]