Rietta.com Security logo
You are reading The Rietta Blog, a publication about the web since 2005.

Rails: Point DNS to to Test Wildcard Subdomains on WEBrick

Want quick method for testing domain/subdomain-based routing logic in your Rails applications? Point a subdomain and wildcard subdomain of your company’s DNS to, your localhost IP address.

Then you can use that domain to access your local test web server on your local machine.

For example, I added DNS “A” records for:

  • test.rietta.com →
  • *.test.rietta.com →

Now Rietta’s developers can each access his local WEBrick server with:

Editing your /etc/hosts file is also an option, but that does not support wildcard domains.

Feel free to use my test subdomains if you want. They will simply point back to your computer.

About Frank Rietta

Frank Rietta's photo

Frank Rietta is a web application security architect, author, and speaker. He is a computer scientist with a Masters in Information Security from the College of Computing at the Georgia Institute of Technology. He speaks about security topics and was a contributor to the security chapter of the 7th edition of the "Fundamentals of Database Systems" textbook published by Addison-Wesley.

If there is a topic you would like us to cover,