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. Commented Jul 4, 2016 at 9:35
  • Is it part of 2.80? I can't seem to find concrete info on that. 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
  • lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2013q2/… Commented Mar 8, 2016 at 15:38
  • And even this: hehan.net/dnsmasq-config.html 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. 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 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. Commented Mar 8, 2016 at 16:05

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.