Welcome to my blog. Help yourself.
Suppose that we have a domain "some.com". We want to use subdomains such as "blog.some.com", "forum.some.com".
How to test it locally?
One approach is to use `/etc/hosts`.
Dns server analyze domains first from local config files. So we can just change the content to meet out requirments.
We can change it as following for testing and recover it after we done the job.
127.0.0.1 www.some.com 127.0.0.1 some.com 127.0.0.1 blog.some.com 127.0.0.1 forum.some.com 127.0.0.1 xxx.some.com
We could not use regex to set the subdomains. So it is a little noisy.