Introduction to Ansible Transcripts
Chapter: Deployments
Lecture: DNS Configuration

Login or purchase this course to watch this video and the rest of the course contents.
0:00 We want our web application to live
0:01 under a nice vanity domain name.
0:03 So I went ahead
0:04 and registered, ansibledeploymentexample.com.
0:06 You can do this through Namecheap
0:08 which is the domain registrar that I use
0:09 or another one like GoDaddy
0:11 there's a bunch of them out there.
0:12 The important part is when you access the domain
0:14 you go to the DNS settings, the domain name system
0:17 which is what maps domain name
0:19 like ansibledeploymentexample.com to an IP address
0:23 which would be our webserver.
0:24 Right now this is set up with the default Namecheap settings
0:27 which is just a landing page
0:29 basically says this domain name has been registered
0:31 by someone so we're going to modify the values
0:34 of the CNAME record and the URL redirect record
0:37 so they're pointing to the webserver that we set up.
0:39 Now obviously I'm doing this under the Namecheap dashboard
0:42 but other domain registrars should have similar DNS pages
0:45 that you can modify with the values that'll correspond
0:48 to your webserver.
0:49 First, instead of a CNAME record
0:51 we need an A record here.
0:52 We're going to point to an address
0:54 not another domain name.
0:55 And then the value should be the IP address
0:57 of our webserver.
0:58 So if we go back over into DigitalOcean
1:00 or we open up the inventory file
1:02 we can copy the webserver address
1:04 and paste in as a value here.
1:06 And you click the little checkbox
1:07 and then under the URL redirect record
1:11 we're going to be setting up HTTPS on our server
1:13 so we'll change this to HTTPS instead of HTTP.
1:19 Check that and now we should be all set.
1:21 The URL redirect record here
1:22 this is for the naked domain.
1:23 So if someone were to type
1:25 in ansibledeploymentexample.com without the www
1:28 they would be redirected
1:29 to the www.ansibledeploymentexample.com subdomain
1:33 which is where our webserver will be running.
1:35 All right, this is all set up now.
1:36 And as the DNS records are being refreshed by Namecheap
1:40 we can set up the rest of our application
1:41 and get to modifying our Ansible playbook.