How to put your bare domain on an awx link
Your domain itself, yourname.com and not a subdomain, can open an app on an awx computer. One DNS record works differently, and it is the one thing to check first.
This post goes with How to put your own domain on an awx link, which uses a subdomain such as app.yourname.com. Here we use the domain on its own. People call it a bare domain, a root domain or an apex. The ending, such as .com or .org, is the top-level domain (TLD). The bare domain is the name you registered, with nothing in front of it.
We tried it on qrlogo.org. The generator from the first post stays at app.qrlogo.org, and the bare domain is now a small landing page that leads to it. Own domains work on the paid plan, one per account. The paid plan is not on sale yet, so we switch people over by hand. The pictures are from a real run on the live service.
Check this first
On a subdomain you add a CNAME record, which says "this name is another name". The DNS rules do not allow an ordinary CNAME on the bare domain itself. So some DNS providers offer their own version, and each calls it something different: CNAME flattening, ALIAS or ANAME. It does what a CNAME would do, at the root.
- If your DNS provider offers one of these, a bare domain works. Cloudflare DNS, which our test domain uses, does this by itself when you add a CNAME at the root.
- If it does not, use
www.yourname.comas a subdomain, as in the first post. Then redirect the bare domain towwwat your registrar or DNS provider.
Look in your provider's help for those three words. It takes a minute and saves a lot of waiting.
What you start with
- An app, or a page, running on your awx computer, on a port such as 8001.
- A domain you own, with access to its DNS settings.
- A DNS provider that can point the root at another name (above).
Step 1: add the domain in the awx dashboard
Open the computer, go to the Links and domains tab, and find the card Your own domain. Type the bare domain, for example qrlogo.org, and the port of the page. Press Add domain. The status says Waiting for DNS, and the card lists the records to add. A note under the list explains the root record.
Step 2: add the records at your domain
The records are the same kinds as for a subdomain, and the same copy buttons are there. The difference is the name of the CNAME: it is the bare domain itself. Most DNS dashboards write that as @, or as the domain name.
| Type | Name | What it does |
|---|---|---|
| TXT | _cf-custom-hostname | Shows that the domain is yours. |
| CNAME | @ (the bare domain) | Sends visitors to awx. Its value is customers.awanbox.com. This is the root record from the section above. |
| TXT | _acme-challenge (two records) | Let the padlock (the HTTPS certificate) be issued. |
Set the CNAME to DNS only if your provider can proxy traffic, so that visitors go straight to awx. The card shows the exact names and values for your domain, so copy them from there.
Step 3: wait, then check
The card checks again by itself every 30 seconds, and Check now asks at once. In our run the ownership check passed as soon as the root record was found. The certificate came a few minutes later, and the status changed to Live. Until then, visitors see a plain "not found" page.
A landing page and an app on one computer
The two names point at two small web servers on the same computer. Port 8000 is the generator. Port 8001 is one static HTML page with a single button that opens app.qrlogo.org. Each one is a service in the Services card, so each restarts by itself if it stops. An account can have one own domain, so the extra name in our test is something we set up ourselves, not an account feature.
qrlogo.org. Its button opens app.qrlogo.org.www too
People often type www in front of a domain. A bare domain on awx does not answer at www by itself, and the paid plan has one own domain, so the simplest way is to let Cloudflare send www to the bare domain. The www name then needs no record pointing at awx, and it does not use your own domain. We did this for mathhh.com, in three steps in Cloudflare.
- A record for www. In DNS, add a record of type
A, namewww, IPv4 address192.0.2.1, with the proxy on (Proxied, the orange cloud). That address is a placeholder that no visitor reaches: Cloudflare answers the request itself. The proxy has to be on, or the next step never runs. - A redirect rule. In Rules, Redirect Rules, create a rule (Cloudflare also has a template called Redirect from WWW to root). Set the request URL to
https://www.mathhh.com/*, the target URL tohttps://mathhh.com/${1}, the status code to 301, and tick Preserve query string. The*at the end of the request URL catches the rest of the address, and${1}puts it back after the domain. Without the*, Cloudflare refuses the rule with Out of bounds replacement reference. - Always Use HTTPS. In SSL/TLS, Edge Certificates, turn on Always Use HTTPS. The rule only matches addresses that start with
https, so without this,http://www.mathhh.comwaits and then fails. It only changes names with the proxy on, so the bare domain, which is DNS only, still goes straight to awx.
Leave the CNAME on the root and the TXT records as they are. Cloudflare's own certificate already covers www, so the padlock works a minute or two after the record is added. Every way of typing the address now ends at the bare domain, with the rest of the address kept:
| Typed | Ends at |
|---|---|
http://www.mathhh.com | https://mathhh.com/, after two redirects |
https://www.mathhh.com/notes?page=2 | https://mathhh.com/notes?page=2 |
http://mathhh.com | https://mathhh.com/ |
If your domain is with another DNS provider, look for its forwarding or redirect setting for a name, and send www to the bare domain with a 301 (permanent) redirect.
Good to know
- One own domain per account. Pick the bare domain or a subdomain. If you want both, point one at awx and redirect the other to it at your DNS provider, as in www too.
- Email on the same domain. If your domain also receives mail, keep its MX records as they are, and check with your DNS provider that the root can have both mail records and the flattened name.
- You keep your domain. It stays with your registrar. awx only receives visitors for the name you add, and removing the entry in the card stops it.
- It is public. Anyone who knows the address can open it while the computer is awake, like a preview link.
Keep reading
- How to put your own domain on an awx link, the subdomain version
- A PHP and MySQL assignment with a public link
- A weather page from a JSON API
Getting started
Sign in with your Google account, give your name and confirm your email. New accounts are approved by hand, and you start on the Free plan. Build a page, make a link, and see Pricing for what the paid plan will include.
Awi, signing off.