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.

3 Answers 3

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.

2
  • Indeed, it doesn't seem to be a thing that is present in upstream code.
    – LtWorf
    Commented Jul 4, 2016 at 9:35
  • Is it part of 2.80? I can't seem to find concrete info on that.
    – KhoPhi
    Commented Sep 15, 2021 at 0:36
1

You're missing the closing :

Your line should look like this:

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

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.

7
  • And even this: hehan.net/dnsmasq-config.html
    – Kartik
    Commented Mar 8, 2016 at 15:38
  • @Kartik, your second link doesn't have a colon after the regex: server=/:.*google.*/8.8.8.8.
    – Ron Maupin
    Commented Mar 8, 2016 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
    Commented Mar 8, 2016 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
    Commented Mar 8, 2016 at 16:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .