DNS

So obviously I bought a domain this week.

You’re visiting it now.

What was that like? Well, I’d been avoiding doing it for years, really. I knew that my first domain would be something I’d never get rid of, and they cost money to maintain. But with all this fun SSL stuff, I just really wanted my own domain.

My first purchase actually fell through. I bought gsp.pro, only to find out that it’s reserved for the .pro top-level domain(TLD).

Here’s the difference between domain registration providers:

  • Namecheap processed my two-dollar (literally $2) payment for this domain, then errored out, and refunded my money within about 30 minutes.
  • Godaddy offered to charge me $70 to ‘try to get’ this domain. Money that clearly would have been a waste.

Namecheap’s CEO then sent the following email: 2018-01-07-01_09_32-Inbox-–-gsp.gsp@gmail.com_-1-261x300.png

I responded, explaining the whole thing about the failed transaction, not sure if the CEO was sincere about his email.

Within a couple hours, I received an email showing a high-priority support ticket had been filed, and that this was a known glitch in their system and that they were working on it.

Kudos namecheap.

Past purchasing the domain of course, I then needed to use Dynamic DNS to associate it with the box hosting this blog, as well as configure email forwarding for the domain.

This was quite easy, although I did have to get into the whole realm of A records and CNAME records.

Email forwarding takes about 2 hours and is a pretty straight-forward process Once email forwarding is working, you can get GMAIL to validate your rights to that email and then you can also send from your gmail account on behalf of the domain. A & CNAME records take only about 30 minutes. Basically, the A record is designated with the ‘@’ sign and represents the bare domain (gsp.cloud, in this case). This is the record that I wanted to forward to my Dynamic DNS provisioned IP.

2018-01-07-01_18_35-Advanced-DNS.png

At one point, I was getting errors from Let’s Encrypt stating “DNS problem: NXDOMAIN looking up A for xyz.gsp.cloud”. This error should probably be “DNS problem: NXDOMAIN looking up A or CNAME for xyz.gsp.cloud” Long story short, to forward the subdomain, I wanted to add a CNAME record to forward any subdomains to the bare domain.

Yep, it’s that easy. Pay a couple bucks, buy a domain, set up your DNS and your email, and you’re good to go.

I guess I didn’t explain the Dynamic DNS too well. If you aren’t familiar with this process, basically you are pinging a remote server with some credentials and the source of that ping is considered to be the appropriate place to forward DNS requests. Previously I’d used DuckDNS (a free Dynamic DNS provider) but for this I switched to ddclient.

My previous DuckDNS container config is as follows:

[user@host ~]$ cat duckdns/create.sh
#!/bin/sh
sudo docker create \
--name=duckdns \
-e PGID=1000 -e PUID=1000 \
-e TZ=America\New_York \
-e SUBDOMAINS=[your subdomain]\
-e TOKEN=[your token] \
--restart=always \
-h duckdns \
--network=network1 \
--ip=192.168.1.200 \
linuxserver/duckdns Here’s the comparable script for ddclient:


[user@host ~]$ cat ddclient/create.sh
#!/bin/sh
sudo docker create \
--name=ddclient \
-v /home/user/ddclient/config:/config \
-e PGID=1000 -e PUID=1000 \
-e TZ=America\New_York \
--restart=always \
linuxserver/ddclient

After starting the container the first time, you’ll propagate the config file. Edit that to include:

[user@host ~]$ cat ddclient/config/ddclient.conf
...
##
use=web, web=dynamicdns.park-your-domain.com/getip
protocol=namecheap
server=dynamicdns.park-your-domain.com
login=gsp.cloud
password=[get this password from namecheap]
@
...

The password will come from namecheap when you setup the Dynamic DNS forward. The @ sign signifies that you are getting DNS For the A record (the bare domain). Replace it with your subdomain name if you only want to route a specific one.

That’s all there is to it.

Written on January 7, 2018