2

An app, running on my laptop in development mode, comprises several Docker containers, one of which runs a Django web app.

This web app expects to receive HTTP requests using a hostname with a variable leading part, e.g. "test-account.survey.com", in which 'test-account' is a slug representing a particular account, and the remaining string 'survey.com' is fixed.

Now I know this can be resolved in a Live environment, involving external HTTP requests, by using wildcard DNS servers [ https://en.wikipedia.org/wiki/Wildcard_DNS_record ].

But I'd like to set up and configure on my laptop a local DNS server for the sole purpose of forwarding hostnames as above to a fixed IP address, e.g. 127.0.0.1 and "passing through" any other hostnames.

Any recommendations? Thanks in anticipation.

P.S. The DNS server must support Windows 10 and Mac OS.

0

People often use dnsmasq for this. You can wildcard sub-domains like this fairly easily for local testing using it.

Here's an example - https://qiita.com/bmj0114/items/9c24d863bcab1a634503 but there are plenty online.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.