By Lea Cards
My DNS records direct to several droplets as specified below:
| hostname | Value |
|---|---|
| *.django | IP#1 |
| *.pipit | IP#2 |
| * | IP#3 |
Navigating to the IP address, each IP displays a different content, as expected.
However, switching the subdomain/Hostname with the IP, all hostnames point to the domaine name. In that case, leacards.site.
How should I then point correctly the subdomain to the specific IP rather than the domain-name?
Thanks for your considertion.
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!
Hello @leacards
To properly handle the subdomains, you need to set up virtual hosts (for Apache) or server blocks (for Nginx) on your droplets to direct the traffic to the correct document root based on the requested domain.
For Apache, you can follow this tutorial to set up virtual hosts: How to Set Up Apache Virtual Hosts on Ubuntu 18.04.
For Nginx, you can follow this tutorial to set up server blocks: How to Set Up Nginx Server Blocks (Virtual Hosts) on Ubuntu 16.04.
Make sure to replace the example domain names with your own subdomains and IP addresses. If you still experience issues, please provide more information about your web server and configuration so we can check this with you.
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.