Adding Non-standard Top-Level Domain (TLD) Websites
With ServBay, you can create and manage local development sites using non-standard top-level domains (TLDs). This approach not only helps you save on domain registration costs, but when combined with ServBay's automatically generated trusted SSL certificates, it also significantly improves the security of your local development environment. This article provides a detailed introduction to the concept of non-standard TLDs, the benefits of using them, and step-by-step instructions on how to easily add non-standard TLD sites in ServBay.
Introduction to Non-standard Top-Level Domains (TLDs)
A Top-Level Domain (TLD) is the highest level in the Domain Name System (DNS) hierarchy, such as .com
, .org
, or .net
. Non-standard TLDs refer to domain suffixes that are not registered or widely used in the public DNS system. These are typically reserved for specific purposes, such as internal networks, local development environments, or testing.
The main advantage of using non-standard TLDs is that they do not resolve on the public internet, making them ideal for creating isolated local development or testing environments.
Note
We do not recommend using the *.test
and *.local
TLDs in ServBay. According to standards like RFC 6762 and RFC 2606, the resolution process for these TLDs is complex and may involve mechanisms like multicast DNS (mDNS), which can result in slower site loading or unstable resolution behavior. It is recommended to use TLDs such as .dev
, .localtest
, .servbay.demo
, or other custom, non-conflicting suffixes.
Common Examples of Non-standard Top-Level Domains
In addition to the not-recommended .test
and .local
TLDs mentioned above, other commonly used or suitable non-standard TLDs for local development include:
.dev
(Note:.dev
is now an HSTS TLD owned by Google, requiring browsers to use HTTPS, which aligns perfectly with ServBay's auto SSL integration).localtest
.servbay.demo
(or your own custom, non-conflicting suffix).example
(reserved for documentation and sample purposes).internal
.lan
By using these non-standard TLDs within your local network or specific development environment, you avoid the need for public DNS registration and configuration.
Benefits of Using Non-standard Top-Level Domains
1. Cost Savings
Developing locally with non-standard TLDs means you do not pay any domain registration or renewal fees. For developers managing many local projects or frequently spinning up test environments, this results in significant cost savings.
2. Enhanced Local Development Security
Since non-standard TLDs do not resolve through the public DNS system, external parties cannot access your local development sites via these domains, minimizing the risk of outside attacks. Combined with ServBay’s automatically generated trusted SSL certificates (via ServBay PKI), your local sites can use HTTPS throughout, further strengthening local communication security and simulating HTTPS usage in production environments.
3. Easier Development and Testing Management
Non-standard TLDs let you assign unique, memorable domains to each local project or test environment (e.g., myproject.dev
, api.localtest
). ServBay automatically handles resolution for these local domains—no need to manually modify the hosts file. This makes managing multiple projects and test environments easier and clearer, improving both development efficiency and test accuracy.
How to Add Non-standard TLD Websites in ServBay
Adding a non-standard TLD website in ServBay is simple and intuitive. ServBay automatically manages local DNS resolution (via its built-in DNS resolver or by modifying the hosts file) and generates/trusts SSL certificates, greatly simplifying setup.
Step 1: Open the ServBay Admin Interface
In your macOS Applications folder, find ServBay
and double-click to launch the application.
Step 2: Navigate to Site Management
Once ServBay launches, you'll see the main interface. In the left navigation menu, click on Sites
to open the site management section.
Step 3: Add a New Website
At the bottom of the site management page, click the +
button. This will open a new form on the right side for entering the configuration details of your new site.
Step 4: Configure Non-standard TLD and Other Settings
In the site creation form, find the “Domain” input box. Here, enter your chosen non-standard TLD domain (e.g., myproject.dev
or api.servbay.demo
).
Continue to fill in the other necessary configuration details for your site, including:
- Document Root: Specify the local path where your website files are located (it is recommended to create a subfolder under
/Applications/ServBay/www/
). - PHP Version: For PHP projects, select the required PHP version.
- Other Settings: Configure settings such as index files, SSL protocol, etc., according to your project's needs.
Step 5: Save Site Configuration
After completing all required fields, click the Save
button at the bottom of the form. ServBay will instantly apply your configuration and complete all necessary backend setup.
Step 6: ServBay Automatically Handles Local Resolution and SSL Certificates
Once saved, ServBay will automatically:
- Local DNS Resolution: ServBay configures your system to ensure your non-standard TLD points to the local environment (usually
127.0.0.1
or::1
). You do not need to manually edit your/etc/hosts
file. - Automatically Generate and Trust SSL Certificates: ServBay uses its built-in ServBay CA (a local certificate authority) to generate a trusted SSL certificate for your non-standard TLD. Since ServBay CA is trusted by your operating system via ServBay PKI, your browser will also trust this locally generated certificate, and you will not see security warnings when accessing your site.
You can now access your local development website in the browser via your configured non-standard TLD (e.g., https://myproject.dev
).
Important Considerations When Using Non-standard TLDs
1. Domain Conflicts
While non-standard TLDs do not conflict with public domains, always ensure your chosen non-standard TLD does not clash with other non-standard domains in use within your local network. Choosing a unique or project-specific TLD can minimize this risk.
2. Restricted Internal Network Access
Remember, these non-standard TLDs are only valid on the local machine running ServBay or within the internal network configured for their DNS resolution. They cannot be accessed from the public internet.
3. Take Full Advantage of ServBay's SSL Integration
For local development, it’s highly recommended to use HTTPS. ServBay’s auto-generated SSL certificates for non-standard TLDs make this effortless, ensuring your environment is as close to production as possible and helping you identify and resolve potential HTTPS-related issues early.
Summary
Using non-standard top-level domains (TLDs) for creating and managing local websites in ServBay is a powerful feature that greatly enhances your local development experience. It not only helps save on domain costs, but with ServBay’s automatic local DNS resolution and trusted SSL certificates, also significantly strengthens your development environment’s security while simplifying multi-project management.
This feature makes it easy to set up unique, manageable development domains for every local project, with no tedious manual configuration required. Whether developing with PHP, Node.js, Python, Go, or Java, working with MySQL, PostgreSQL, MongoDB, Redis, or configuring web servers like Caddy/Nginx, ServBay plus non-standard TLDs provides an efficient, secure, and flexible local development platform.
Start adding your first non-standard TLD website in ServBay today!