Tuesday, November 11, 2014

Localhost Tip of the Year: Wildcard Subdomains

There comes a time in life when you just need to have the wildcard localhost subdomains.

/etc/hosts won't help you.

Yes, you can roll out bind, named, and whatever else. But there is a simpler and good-enough solution.

Use vcap.me instead of localhost.
vcap.me is a public name (owned by VMWare, so it's pretty solid) that resolves into 127.0.0.1.

But wait, there is more. *.vcap.me also resolves into 127.0.0.1.

> nslookup whatever.vcap.me
Non-authoritative answer:
Name:    whatever.vcap.me
Address:  127.0.0.1

Now you have it: a wildcard domain that resolves into 127.0.0.1.

*.vcap.me

No comments:

Post a Comment