Domain Routing

How to setup direct DNS routing

Direct Routing

The Domain Name System (DNS) is the global “phone book” which powers the internet. It makes it possible for browsers search for your server’s IP address by its domain name. You can route traffic to your sites using direct DNS routing, as described in this guide.

Using Cloudflare? Check out our Cloudflare routing guide.

Should you use direct routing instead of a CDN?

Generally, no.

We recommend that you put your site behind a content delivery network. Cloudflare is one such network which has a great free tier. We use that free tier for this blog with no issues, and we benefit greatly from their edge caching.

Directly exposing your server to the internet opens you up to DDoS attacks, among other things, as your single server must process each and every request. A CDN’s edge cache will greatly reduce the amount of requests that end up hitting your server, meaning your server is able to handle more active visitors at once before you need to scale up.

Direct routing:

  1. Log in to your DNS or domain registrar account.
    • Contact your registrar if you are unsure of how to access your DNS records.
    • If they ask for more money for DNS services, you may want to consider setting up the domain with Cloudflare, and then you can disable the proxy from there if you really want free direct routing.
  2. Determine which domains and subdomains you are using
    • A domain name is a backwards chain of names, starting at the top-level domain (TLD), such as .com or .net.
      • For example, dev.test.com would read like so:
        • dev is a subdomain of test.com
        • test is a subdomain of the .com TLD
      • If you wanted to use test.com, you might choose:
        • dev.test.com for your development site, where dev is the subdomain in your DNS server settings.
        • www.test.com and test.com for your live site, where www subdomain and the root domain itself are displayed in your DNS settings.
          • Note that the root domain is sometimes displayed as an @ symbol, or a single period.
          • Your registrar’s DNS panel should indicate what to insert for the root domain, as this is a very common use case.
    • Common subdomains include www, dev, staging, and the root domain.
  3. Add “A” records for your domains and subdomains
    • From within your DNS provider’s website, add “A” records for each subdomain, and point them at the correct server IP address.
      • You can access each server’s IP address from the WordFleet dashboard.
  4. Save the records.
    • Note that the changes may take up to 24 hours to take effect worldwide.
    • One additional benefit of using a CDN is that site routing updates are typically much faster (if not instant).

Considerations

Site Encryption

In the Encryption tab of your site’s configuration, you will want to select Let’s Encrypt, which automatically generates free and trusted TLS (SSL) certificates. You can also select No Encryption – but we recommend against that.

Domain Configuration

Don’t forget to configure your site to use the selected domains and subdomains. The server can’t reply correctly to a request from a browser unless it’s told before hand which domains point to the appropriate site.