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 under a nice vanity domain name. So I went ahead and registered, ansibledeploymentexample.com.
0:07
You can do this through Namecheap which is the domain registrar that I use or another one like GoDaddy there's a bunch of them out there.
0:13
The important part is when you access the domain you go to the DNS settings, the domain name system which is what maps domain name
0:20
like ansibledeploymentexample.com to an IP address which would be our webserver. Right now this is set up with the default Namecheap settings
0:28
which is just a landing page basically says this domain name has been registered by someone so we're going to modify the values
0:35
of the CNAME record and the URL redirect record so they're pointing to the webserver that we set up.
0:40
Now obviously I'm doing this under the Namecheap dashboard but other domain registrars should have similar DNS pages
0:46
that you can modify with the values that'll correspond to your webserver. First, instead of a CNAME record we need an A record here.
0:53
We're going to point to an address not another domain name. And then the value should be the IP address of our webserver.
0:59
So if we go back over into DigitalOcean or we open up the inventory file we can copy the webserver address and paste in as a value here.
1:07
And you click the little checkbox and then under the URL redirect record we're going to be setting up HTTPS on our server
1:14
so we'll change this to HTTPS instead of HTTP. Check that and now we should be all set. The URL redirect record here this is for the naked domain.
1:24
So if someone were to type in ansibledeploymentexample.com without the www they would be redirected to the www.ansibledeploymentexample.com subdomain
1:34
which is where our webserver will be running. All right, this is all set up now. And as the DNS records are being refreshed by Namecheap
1:41
we can set up the rest of our application and get to modifying our Ansible playbook.