Excourse: Domains and Subdomains
Before installingyou yourinstall firstany application,self-hosted it'sapplications, importantmake to understand subdomains - they're how you'll access different services on your server, whilesure your domain itselfsetup (www.myWebsite.com)is should maybe point to your website that you create with WordPress.solid. This chapter explains whathow subdomainsto arepoint your main domain to the place you want visitors to land (often a WordPress site) and how to setcreate themsubdomains for the services you'll run on your server.
Why this chapter moved earlier: Planning your domains before you touch your server saves time, avoids SSL headaches, and helps you launch with a professional-looking setup from the start.
Start with Your Main Domain
Your main domain (also called the apex domain or root domain) is what people type to reach your primary site, e.g., myinfinitytools.com. Decide what should load there first. Many beginners want this to serve their public website, often powered by managed WordPress hosting.
Typical Beginner Setup
- Main domain: Points to hosted WordPress or another website builder.
- www subdomain: Usually points to the same place as the main domain.
- Service subdomains: Point to your self-hosted server (Vaultwarden, Nextcloud, etc.).
If you already have WordPress hosting, your provider will give you the DNS records to use. Keep those for the main domain and www, then add new records for each self-hosted service you plan to deploy.
Pointing the Main Domain to WordPress
Most managed WordPress hosts (WordPress.com, Kinsta, Flywheel, SiteGround, etc.) will ask you to create:
- An A record for
@(the main domain) pointing to their IP address, or a CNAME if they provide one. - A CNAME record for
wwwpointing to either@or a host-specific target likeyour-site.wordpress.com.
Set up withthese two records first. Once your hostingmain provider.site works, continue with the rest of this guide to add subdomains for your self-hosted apps.
What is a Subdomain? (Simple Explanation)Beginner-Friendly)
A subdomain is like a separate address within your main website. Think of it as different rooms in the same house - each room has its own purpose, but they're all part of the same building.
Examples of subdomains:
vault.myinfinitytools.com- For your password managerfiles.myinfinitytools.com- For your file storageblog.myinfinitytools.com- For your websiteadmin.myinfinitytools.com- For your admin panel
Breaking Down a Subdomain
Let's look at vault.myinfinitytools.com:
- vault - This is the subdomain (the "room")
- myinfinitytools - This is your domain name (the "house")
- com - This is the top-level domain (the "neighborhood")
Why Do We Need Subdomains?
Subdomains help organize your services and make them easier to access:
- ✅ Easy to remember -
vault.mydomain.comis clear - ✅ Professional looking - Each service has its own address
- ✅ SSL certificates work better - Each subdomain gets its own certificate
- ✅ Easy to manage - You can move services around easily
Without subdomains: You'd have to use ports like mydomain.com:8080 or mydomain.com:3000 - much harder to remember!
CommonPlan SubdomainYour PatternsSubdomains
HereStart area somesimple commonlist subdomainof namesthe forservices differentyou services:plan to run. These examples can inspire your own naming scheme:
Security Services
vault.mydomain.com- Password manager (Vaultwarden)admin.mydomain.com- Admin panelvpn.mydomain.com- VPN access
File and Storage Services
files.mydomain.com- File storage (Nextcloud)sync.mydomain.com- File synchronizationbackup.mydomain.com- Backup management
Web and Content Services
blog.mydomain.com- Blog or website (WordPress)docs.mydomain.com- Documentationwiki.mydomain.com- Knowledge base
Monitoring and Analytics
stats.mydomain.com- Analytics (Matomo)monitor.mydomain.com- Server monitoringstatus.mydomain.com- Status page
How to Create Subdomains
The process varies by hosting provider, but the general steps are the same. You need to createCreate DNS records that point your subdomainsmain domain and www to the correct host (WordPress, static site, etc.), then add separate records for each subdomain that should resolve to your server'sself-hosted IP address.server.
Step 1: Get Your Server's IP Address
First, you need to know your server's IP address. You can find this in your server provider's dashboard or by running this command on your server:
curl ifconfig.me
This will show you your server's public IP address (something like 123.456.789.012).
Step 2: Access Your DNS Management
Log into your domain registrar or hosting provider and look for:
- DNS Management
- DNS Settings
- Domain Management
- Name Servers
Provider-Specific Instructions
Below are examples from popular registrars and DNS hosts. The screens change over time, but the record types stay the same. Use these steps for your main domain and every subdomain you plan to run self-hosted services on.
Hetzner Cloud
If you bought your domain through Hetzner or are using Hetzner DNS:
- Log into your Hetzner Cloud Console
- Go to DNS in the left menu
- Select your domain from the list
- Click "Add Record"
- Choose "A Record"
- Enter your subdomain name (e.g.,
vault) - Enter your server's IP address
- Click "Save"
Example: To create vault.myinfinitytools.com:
- Name:
vault - Type:
A - Value:
123.456.789.012(your server IP)
Cloudflare
If you're using Cloudflare for DNS:
- Log into your Cloudflare Dashboard
- Select your domain
- Go to DNS → Records
- Click "Add record"
- Choose "A" record type
- Enter your subdomain name
- Enter your server's IP address
- Set TTL to "Auto"
- Click "Save"
Namecheap
If you bought your domain through Namecheap:
- Log into your Namecheap account
- Go to Domain List
- Click "Manage" next to your domain
- Go to the "Advanced DNS" tab
- Click "Add New Record"
- Choose "A Record"
- Enter your subdomain name in the Host field
- Enter your server's IP address in the Value field
- Set TTL to "Automatic"
- Click the Save icon
GoDaddy
If you're using GoDaddy:
- Log into your GoDaddy account
- Go to My Products
- Find your domain and click "DNS"
- Click "Add" in the Records section
- Choose "A" record type
- Enter your subdomain name in the Name field
- Enter your server's IP address in the Value field
- Set TTL to "1 Hour"
- Click "Save"
Porkbun
If you're using Porkbun:
- Log into the Porkbun Domain Management panel.
- Click Details next to your domain.
- Scroll to the Quick DNS Config section and click Edit.
- Add an A record for each subdomain pointing to your server IP.
- Add or edit the A/CNAME records for
@andwwwif you host WordPress elsewhere. - Click Save Changes.
Google Domains / Squarespace Domains
If your domain lives in Google Domains (now run by Squarespace):
- Sign in at domains.google.
- Select your domain and open the DNS tab.
- Under Custom records, click + Add record.
- Choose A and add records for
@and your subdomains (e.g.,vault). - For WordPress or other hosted sites, add the CNAME record for
wwwexactly as your host requests. - Click Save.
OVHcloud
If you're on OVH:
- Log into the OVHcloud Manager.
- Open Domains → select your domain → DNS zone.
- Click Add an entry and choose A.
- Enter the subdomain (e.g.,
files) and your server IP. - Repeat for each subdomain and adjust the existing
@/wwwrecords if WordPress provides different targets. - Confirm changes.
Understanding DNS Propagation
After creating a subdomain, it takes time for the change to spread across the internet. This is called DNS propagation.
How Long Does It Take?
- Usually: 5-30 minutes
- Sometimes: Up to 24 hours
- Rarely: Up to 48 hours
How to Check if It's Working
You can test if your subdomain is working by visiting it in your browser:
- Go to
https://vault.yourdomain.com - If you see a page (even an error), the subdomain is working
- If you get "This site can't be reached", it's still propagating
Testing with Command Line
You can also test from your server:
# Test if subdomain resolves
nslookup vault.yourdomain.com
# Test if it points to your server
dig vault.yourdomain.com
PlanningCreate Your SubdomainsDomain Checklist
Before installing applications, planmap whichout subdomainsevery you'llDNS need:record you want in place. This keeps your launch organized and helps you avoid downtime on your main site.
Essential SubdomainsRecords
These are the records most commonbeginners onesconfigure you'llon need:day one:
@→ WordPress host IP or provided CNAME targetwww→ CNAME pointing to@or your WordPress providervault.yourdomain.com-→PasswordYourmanagerserver IP for Vaultwardenfiles.yourdomain.com-→FileYourstorageserver IPblog.yourdomain.com-forWebsiteNextcloud orblogfile admin.yourdomain.com- Admin panel (optional)storage
Optional Subdomains
You might wantAdd these later:after your core services are live:
blog.yourdomain.com→ Alternate blog or marketing siteadmin.yourdomain.com→ Admin panel (use with caution, see security tips)sync.yourdomain.com-→ File synchronization endpointstats.yourdomain.com-→ Analytics tools like Matomomonitor.yourdomain.com-→ServerMonitoringmonitoringdashboardsbackup.yourdomain.com-→ Backup management interface
Best Practices
Naming Conventions
- ✅ Use descriptive names -
vaultinstead ofapp1 - ✅ Keep them short -
filesinstead offile-storage-system - ✅ Use lowercase -
vaultnotVault - ✅ Avoid special characters - No spaces, symbols, or accents
Security Considerations
- ✅ Don't use obvious names - Avoid
adminfor sensitive services - ✅ Use random names for sensitive services -
a7b9c2instead ofadmin - ✅ Document your subdomains - Keep a list of what each one does
Troubleshooting
Subdomain Not Working
If your subdomain isn't working:
- Check the DNS record - Make sure it points to the right IP
- Wait for propagation - Give it 30 minutes to an hour
- Check for typos - Make sure the subdomain name is correct
- Test with different tools - Try
nslookupor online DNS checkers
Common Mistakes
- ❌ Including the full domain in the host field - Use
vaultnotvault.mydomain.com - ❌ Pointing your main domain to the wrong place - Double-check WordPress instructions before editing
@andwww - ❌ Wrong IP address - Make sure you're using your server's public IP
- ❌ Wrong record type - Use "A" record, not "CNAME" for IP addresses
- ❌ Not saving the record - Make sure to click "Save" after creating
Quick Reference
Find your server IP:
curl ifconfig.me
Verify your main domain record:
nslookup yourdomain.com
Test subdomain resolution:
nslookup vault.yourdomain.com
Test from browser:
https://vault.yourdomain.com
You're Ready!
Now you understand subdomains and how to createprepare them!both your main domain and subdomains! This knowledge will be essential as you install applications like Vaultwarden, Nextcloud, and WordPress.connect your WordPress site.
What you learned:
- ✅ How to point your main domain - Keep WordPress or another host online while you self-host services
- ✅ What subdomains are - Separate addresses for different services
- ✅
WhyHowthey'retousefulplan them -Organization,BuildSSL,aandchecklistprofessionalbeforeappearanceinstalling apps - ✅ How to create
themDNS records -DNSStep-by-steprecordsinstructionswithforyourpopularhosting providerproviders - ✅ How to test
themeverything - Browser and command-line methods ✅Best practices- Naming conventions and security
Next step: You're now ready to installcontinue with your firstinstallation application!chapters. InAs theyou nextdeploy chapter,each we'llapplication, installcome Vaultwardenback to this checklist and usecreate the subdomain you justplanned created.for it.
What You Learned
- Main domain setup - How to point
@andwwwto WordPress or another host - Subdomains - Separate addresses for different services on your domain
- DNS Records - How to point
subdomainseach subdomain to your server - DNS Propagation - How long it takes for changes to take effect
- Testing Methods - How to verify both main and subdomains are working
- Planning - How to organize your services with
subdomainsa checklist
You now have the foundation knowledge needed to set up professional-looking, organized services on your server!
Next: InstallingProceed Vaultwardenwith -your Yourchosen Passwordinstallation Managerchapter (Chaptere.g., 5)Vaultwarden) now that your domains are ready.