I would like to make better use of wildcards for my droplets, but I can’t seem to get it right.
Ideally I would like all *-dev.domain.com sites to point to my DEV server, and *-staging to my staging server, without having to manually set this up each time.
Neither *.dev, *-dev or *_dev or *dev seem to behave as expected for newsite.dev.domain.com, newsite-dev.domain.com, newsite_dev.domain.com or newsitedev.domain.com.
Is there a way to utilise wildcard networking is this manner, other than *.domain.com.
Thanks!
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!
Heya,
Just came across this answer and decided to write some general guidelines for anyone who comes across this in the future despite the old question.
Appreciating your question on wildcards for droplets and domain handling, unfortunately, DNS does not support the types of wildcard patterns you mentioned. Wildcards in DNS work only on the “any subdomain” principle. You can set a record for *.domain.com, but not for more specific patterns like *-dev.domain.com or *-staging.domain.com.
However, DigitalOcean does offer Load Balancers and Floating IPs that can help distribute incoming traffic across multiple Droplets, which may be a good workaround for your need to serve different environments (e.g., dev, staging). You’ll have to configure your application to handle routing based on the subdomain.
For more information on DNS, you can check out the DigitalOcean DNS Documentation. For details on Load Balancers and Floating IPs, please check the Load Balancers Documentation and Floating IPs Documentation.
Hope that this helps!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.