-: So let's talk about the two DNS settings
you can find it in the VPC.
So the first one is DNS resolution called
ENA enableDnsSupport.
And this is to decide if DNS resolution from Route 53
resolver is supported from the VPC.
So by default, the setting is true.
And that means that each two instances within your VPC will
be able to query the Amazon provided DNS server at either
the IP 169.254.169.253,
or the reserved IP that we mentioned before that is at the
base of the VPC IP four network range plus two.
So the point to address. So if we have a look,
so we have DNS support enabled for this VPC, okay.
The second setting,
we'll see what it means in the next slide.
And so if we want to ask for Google.com then because we
have enableDnsSupport,
then the EC2 Instance can reach out to the routes with
resolver using one of the two IPs I mentioned,
and then we'll get the answer of where Google.com is,
and then we'll get access to the internet.
This has to be able to have DNS resolution for public
addresses.
Now, if you have no DNS support,
then it is still possible for you to get DNS resolution,
but you need to create your own custom DNS server,
configure it and so on.
And then you'll be able to get the same answer.
But it is quite natural to use the managed services in AWS.
So when you enable the DNS support setting,
then you can leverage route 53 to resolve the public DNS
names within the internet.
The next setting is DNS host name. So enableDnsHostnames.
And by default is true. If you have a default VPC or false,
if you have a newly created VPC.
It will not do anything unless you also enable the setting
from before. So enableDnsSupport equals true.
And if DNS Hostname is true,
that means that your EC2 instance will get a public
public host name.
If it also has a public IP for as we'll see in the next
lecture. So without it, so without the DNS host I'm setting,
as you can see, EC2 Instance just has a private DNS,
even though it sits in a public subnets,
but with DNS support and DNS Hostanme my EC2
instance, has a private DNS of course,
but also has a public DNS that corresponds to its public IP.
So this is what the DNS host name setting does.
And why do we want to enable both of these settings?
Well,
if you have a custom DNS domain name in a private hosted
zone in Route 53,
and you said to both of these attributes to true,
then you can create this private hosted zone as we'll see in
the hands-on for example,
web.mycompany.private as a record of type A
and the value 10.0.0.10.
And the reason we do so is that now an EC2 Instance in
the private subnets can have a private DNS name associated
with a private IP before.
And you're EC2 Instance when requesting that private DNS
name, we'll look it up to the Route 53 resolver,
which we'll look up the private hosted zone and say, yes,
I know what this is. This is 10.0.0.10.
And then the EC2 Instances will know how to reach out to the
other EC2 Instance. Okay.
So hopefully this will make a lot of sense in the next
lecture. So I will see you there.