DNS


Using my domain, riowing.net, on DNS domains.google.com as example.

Here are some output of nslookup:

nslookup.exe tech.riowing.net
Server: resolver1.opendns.com. DNS used since we didn’t explicitly say which one to use
“Non-authoritative answer” because tech.riowing.net is not directly on this server
Address: 52.8.195.114 this is the IP returned for tech.riowing.net
To get rid of the word “Non-authoritative”, we do:
nslookup.exe tech.riowing.net ns-cloud-c1.googledomains.com

nslookup.exe -qt=mx riowing.net
riowing.net MX preference = 10, mail exchanger = riowing.net
Therefore, emails to me@riowing.net go to host riowing.net, which is also my email server name.

“Registered hosts” or “glue records” is to avoid loop when name server used is subdomain, e.g. dns.riowing.net. I don’t need this since I use Google Domains nameservers instead of my own, e.g. ns-cloud-c1.googledomains.com

Setup CDN on DNS


Depending on how much control given to CDN provider, most to least, here are the four config options.
Assumption: we are the video content provider and our server domain name is awsq.MaxxSports.cc
1. Redirect to CDN’s domain name with CNAME
2. Change my DNS so that it uses CDN’s Nameservers to resolve awsq.MaxxSports.cc
3. By A record, let awsq.MaxxSports.cc point to CDN’s IP.
4. Use a separate domain name for CDN access, e.g. d2t4kyunpgtwxc.cloudfront.net

More details for the four options, with the same numbering.
1. we have least control, since all our DNS does is just a redirection. This is the setup of Tencent CDN, like *.cdn.dnsv1.com
2. CDN has much control. For requests of awsq.MaxxSports.cc, CDN decides which IP to resolve to, e.g. depending on each user’s geographic location.
Taking CloudFlare as an example, after login at https://dash.cloudflare.com/login, it asks to update my DNS settng at enom.com with those nameservers: scott.ns.cloudflare.com venus.ns.cloudflare.com
Since multiple domain names could share one CDN’s IP, users can only access http://awsq.MaxxSports.cc by domain name, instead of direct IP.
3. since the A record is maintained at my DNS, namely enom.com, I know the CDN’s IP my domain name is mapped to. This is not good as we loses the ability to dynamically map domain name to different IPs in different country for example.
4. this is the setup we use for our streaming server, e.g. d2t4kyunpgtwxc.cloudfront.net. Requests for awsq.MaxxSports.cc go to our original server, and requests for d2t4kyunpgtwxc.cloudfront.net go to our CDN servers.