Dokku and Subdomain forwarding

  • Posted on September 1, 2014
  • minh.nAsked by minh.n

Hello. I’m a bit new to all this so please bare with me. I’ve set up Dokku with a very simple rails app following:

The app is toy-app and I’ve set Dokku to use subdomain like this tutorial:

My zone file is:

$TTL	1800
			1409595135 ; last update: 2014-09-01 18:12:15 UTC
			3600 ; refresh
			900 ; retry
			1209600 ; expire
			1800 ; ttl
             IN      NS      NS1.DIGITALOCEAN.COM.
                     NS      NS2.DIGITALOCEAN.COM.
                     NS      NS3.DIGITALOCEAN.COM.
@	IN A
*	IN A
toy-app	IN A
sample-app	IN A
*.toy-app	CNAME
*.sample-app	CNAME

I plan on having another app called sample-app and have go to that app. I want my to lead to no where for now. But right now and both goes to

Why is this? Is it because the * A record I have? I thought that just meant anything before would be forward to the ip but then dokku would check if it matches the subdomain name, if not it won’t serve the app?

Thanks for your time.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

You need to modify the Virtual Host config file for toy-app, and put this in:


above < Directory >

Also, do the same for all other vhosts. When hosting more than one domain, it needs to know which vhost the config is for, or it goes to the default

If that doesn’t work, and you’re running CentOS/Fedora, edit /etc/httpd/conf/httpd.conf and uncomment

NameVirtualHost 80

reload/restart apache2/httpd, and you should be good.