2

I have dnsmasq version 2.66 installed on CentOS. As per release notes, dnsmasq supports regular expressions starting 2.60

I have following enty in my config file:

address=/:clients[0-9]*\.google\.com/192.168.10.2

This single entry should resolve the address for urls matching clients.google.com and clients3.google.com to address 192.168.10.2 but it does not.

Please suggest a solution for this issue.

Kartik
  • 267
  • 2
  • 9

3 Answers3

1

I think the regular expression feature is only a patch for v2.63. I checked the Makefile and .conf file in the main branch, there is no "regex" macro.

NULL
  • 111
  • 1
1

You're missing the closing :

Your line should look like this:

address=/:clients[0-9]*\.google\.com:/192.168.10.2

Vik_2019
  • 11
  • 1
0

Are you sure that the :s are correct in your regex ? I don't see any reference to using them in the documentation.


I've tried this with and without colons. I'm not convinced that this is working, especially as the official documentation makes no reference to it. Some unofficial references also suggest that this may only be a feature for the server directive.

user9517
  • 114,104
  • 20
  • 206
  • 289
  • http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2013q2/007124.html – Kartik Mar 08 '16 at 15:38
  • And even this: http://hehan.net/dnsmasq-config.html – Kartik Mar 08 '16 at 15:38
  • @Kartik, your second link doesn't have a colon after the regex: `server=/:.*google.*/8.8.8.8`. – Ron Maupin Mar 08 '16 at 15:55
  • Sorry my mistake. The second colon is not suppose to be in the question. The thing does not work even when there is just colon at the start – Kartik Mar 08 '16 at 16:02
  • @Kartik, the first link does have the second colon: `server=/:myvpn[0-9]*\.company\.com:/4.1.1.1`. My point is that your two links aren't consistent. You may need to dig a little more on how to use this. – Ron Maupin Mar 08 '16 at 16:05
  • You are correct. I did not notice. However, i tested both and neither worked. But the discrepancy between the two indicates neither may be correct. I will keep digging. Thanks – Kartik Mar 08 '16 at 16:47
  • @Kartik After 4 years of digging, any good news? I'm on 2.80 dnsmasq at the moment, and can't seem to find any info on whether it supports regex outta the box, or I gotta compile my own – KhoPhi Sep 15 '21 at 00:35