Re: [Dnsmasq-discuss] --synth-domain enhancement
Finally got around to doing this. http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=6b2b564ac34cb3c862f168e6b1457f9f0b9ca69c Cheers, Simon. On 19/02/18 09:16, Andy Hawkins wrote: > Hi, > > In article <11034711-6140-1e7c-5eeb-ad951fee2...@thekelleys.org.uk>, >Simon Kelleywrote: >> My second example gives exactly that. To clarify, the serial numbers in >> the names correspond to the addresses in the range supplied. If you use >> a subnet to specify the range, for instance 192.168.202.0/24, then yes >> dyn-1 will be 192.168.202.0, but if you use start,end to specify the >> range, then the start address becomes dyn-1, so for >> >> --synth-domain=gently.org.uk,192.168.202.50,192.168.202.70,dyn-* >> >> 192.168.202.50 is dyn-1 > > Ah, apologies, I hadn't realised that. In that case then, this sounds > perfect to meet my needs. > >> (or maybe dyn-0. Do we want this one-based or zero-based? Having a >> choice is NOT an option) > > I think I'd want dyn-1 personally, but don't feel particularly strongly > about it either way to be honest. > > Thanks. > > Andy > > > ___ > 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] --synth-domain enhancement
On Mon, Feb 19, 2018 at 10:41:01AM +0100, Dominik DL6ER wrote: > On 16.02.2018 16:01, Simon Kelley wrote: > > To clarify, the serial numbers in > > the names correspond to the addresses in the range supplied. If you use > > a subnet to specify the range, for instance 192.168.202.0/24, then yes > > dyn-1 will be 192.168.202.0, but if you use start,end to specify the > > range, then the start address becomes dyn-1 > That's exactly why I think zero-indexed would be better, as dyn-50 would > then also correspond to 192.168.202.50. For custom ranges (not starting > from zweo) I have no preference, but the logic should obviously be the > same as for the full /24 network. Here another +1 for starting at 0. So | --synth-domain=gently.org.uk,192.168.202.50,192.168.202.70,dyn-* would in /etc/hosts format 192.168.202.50dyn-0.gently.ork.uk 192.168.202.51dyn-1.gently.ork.uk 192.168.202.52dyn-2.gently.ork.uk And indeed, on networks where network address ends on zero, there it will be 192.0.2.0 string0 192.0.2.1 string1 192.0.2.2 string2 192.0.2.3 string3 Another thing, "rollover" 192.0.2.9 string9 192.0.2.10 string10 Should it be "%03d", so 192.0.2.8 string008 192.0.2.9 string009 192.0.2.10 string010 # 192.0.2.99 string099 192.0.2.100 string100 192.0.2.101 string101 Groeten Geert Stappers -- Leven en laten leven ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] --synth-domain enhancement
On 16.02.2018 16:01, Simon Kelley wrote: > To clarify, the serial numbers in > the names correspond to the addresses in the range supplied. If you use > a subnet to specify the range, for instance 192.168.202.0/24, then yes > dyn-1 will be 192.168.202.0, but if you use start,end to specify the > range, then the start address becomes dyn-1 That's exactly why I think zero-indexed would be better, as dyn-50 would then also correspond to 192.168.202.50. For custom ranges (not starting from zweo) I have no preference, but the logic should obviously be the same as for the full /24 network. Best regards, Dominik ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] --synth-domain enhancement
Hi, In article <11034711-6140-1e7c-5eeb-ad951fee2...@thekelleys.org.uk>, Simon Kelleywrote: > My second example gives exactly that. To clarify, the serial numbers in > the names correspond to the addresses in the range supplied. If you use > a subnet to specify the range, for instance 192.168.202.0/24, then yes > dyn-1 will be 192.168.202.0, but if you use start,end to specify the > range, then the start address becomes dyn-1, so for > > --synth-domain=gently.org.uk,192.168.202.50,192.168.202.70,dyn-* > > 192.168.202.50 is dyn-1 Ah, apologies, I hadn't realised that. In that case then, this sounds perfect to meet my needs. > (or maybe dyn-0. Do we want this one-based or zero-based? Having a > choice is NOT an option) I think I'd want dyn-1 personally, but don't feel particularly strongly about it either way to be honest. Thanks. Andy ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] --synth-domain enhancement
On 15/02/18 17:12, Andy Hawkins wrote: > Hi, > > In article <774c6255-31dd-a6f3-d208-11aa41b9c...@thekelleys.org.uk>, >Simon Kelleywrote: >> It could be done: just requires even more scary string-mangling in >> src/domain.c and inventing a way to configure it. >> >> I prosose something like >> >> --synth-domain=thekelleys.org.uk,192.168.0.0/24,internal-* >> >> where the final * in the prefix generates "counting mode" so that >> >> 192.168.0.0 becomes internal-0,thekelleys.org.uk >> >> A range rather than a subnet is already allowed, so your example becomes >> >> >> --synth-domain=gently.org.uk,192.168.202.50,192.168.202.70,dyn-* >> >> >> Anyone got a better idea? > > That sounds good to me. The only thing missing is the 'arithmetic' bit on > the generated host name / IP address. > > In your example above, I would want (for example) > > 192.168.202.50 - dyn-1 > 192.168.202.51 - dyn-2 > > etc. > > This is possible in bind using the syntax I posted earlier, but isn't (yet) > in dnsmasq. My second example gives exactly that. To clarify, the serial numbers in the names correspond to the addresses in the range supplied. If you use a subnet to specify the range, for instance 192.168.202.0/24, then yes dyn-1 will be 192.168.202.0, but if you use start,end to specify the range, then the start address becomes dyn-1, so for --synth-domain=gently.org.uk,192.168.202.50,192.168.202.70,dyn-* 192.168.202.50 is dyn-1 (or maybe dyn-0. Do we want this one-based or zero-based? Having a choice is NOT an option) Cheers, Simon. > > It's hardly the end of the world if I have to manually enter each one > though, so I wouldn't push for this change too much if it turned out to be > particularly difficult or generate any strong objections. > > Andy > > > ___ > 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] --synth-domain enhancement
Hi, In article <774c6255-31dd-a6f3-d208-11aa41b9c...@thekelleys.org.uk>, Simon Kelleywrote: > It could be done: just requires even more scary string-mangling in > src/domain.c and inventing a way to configure it. > > I prosose something like > > --synth-domain=thekelleys.org.uk,192.168.0.0/24,internal-* > > where the final * in the prefix generates "counting mode" so that > > 192.168.0.0 becomes internal-0,thekelleys.org.uk > > A range rather than a subnet is already allowed, so your example becomes > > > --synth-domain=gently.org.uk,192.168.202.50,192.168.202.70,dyn-* > > > Anyone got a better idea? That sounds good to me. The only thing missing is the 'arithmetic' bit on the generated host name / IP address. In your example above, I would want (for example) 192.168.202.50 - dyn-1 192.168.202.51 - dyn-2 etc. This is possible in bind using the syntax I posted earlier, but isn't (yet) in dnsmasq. It's hardly the end of the world if I have to manually enter each one though, so I wouldn't push for this change too much if it turned out to be particularly difficult or generate any strong objections. Andy ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] --synth-domain enhancement
On 23/01/18 09:25, Andy Hawkins wrote: > Hi, > > I'm contemplating a move from bind and isc-dhcpd to dnamasq. > > One of the features of bind that I take advantage of in my domain is > generating sequences of DNS entries using a single line. For example, in my > zone file I have: > > $GENERATE 50-70 dyn-${-50} IN A 192.168.202.$ > > This will generate the following DNS entries: > > dyn-0.gently.org.uk on address 192.168.202.50 > dyn-1.gently.org.uk on address 192.168.202.51 > > ... > > dyn-19.gently.org.uk on address 192.168.202.69 > dyn-20.gently.org.uk on address 192.168.202.70 > > I realise that dnsmasq has the 'synth-domain' option, but the names > generated by this are a little ugly. Is there any chance an enhancement > could be made to so something similar to the facilities available in bind? > It could be done: just requires even more scary string-mangling in src/domain.c and inventing a way to configure it. I prosose something like --synth-domain=thekelleys.org.uk,192.168.0.0/24,internal-* where the final * in the prefix generates "counting mode" so that 192.168.0.0 becomes internal-0,thekelleys.org.uk A range rather than a subnet is already allowed, so your example becomes --synth-domain=gently.org.uk,192.168.202.50,192.168.202.70,dyn-* Anyone got a better idea? Cheers, Simon. ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss