How to test wildcard subdomains on CircleCI

If you need to test wildcard subdomains in a CI environment there are a few options available to you.

A simple one is to use the free service at that resolves itself along with all subdomains to localhost. Using this you can set tests to run at something like and you’re done.

Another option is to install and use dnsmasq. You can add an entry like:

# Wildcard DNS entries

That would mean dnsmasq will return A records for all domains ending in .test pointing them at localhost:

$ dig +noall +answer example.test
example.test.              0       IN      A
$dig +noall +answer foo.example.test
foo.example.test.          0       IN      A

Very cool, thanks for sharing Tom!

@tom it would be really helpful if you outlined a more-complete “how to install and use dnsmasq”.

When I tried it in an ssh session on circleci, I found that (after sudo apt-get install dnsutils) dig example.test to just fine, however curl -v example.test could not resolve it at all. It felt like the precipice of a rabbit hole so I decided to quit and just use for now but for the inevitable day that it quits resolve (as did today), I’d like to better understand how to use dnsmasq for a simple use case like this…

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.