You have created a custom VPC with public and private subnets.
You will also be setting up a VPN connection with your organization to communicate with resources within the VPC.
Your organization would need DNS names for some of the on-premise applications to communicate with VPC resources.
You have launched a new EC2 instance with Auto-assign public IP as enable.
When the instance is ready to use, you found that the Public DNS name is missing.
What should be done to enable it?
Click on the arrows to vote for the correct answer
A. B. C. D.Answer: A.
By default, both attributes are set to '
true'
in a default VPC or a VPC created by the VPC wizard.
The following rules apply:
If both attributes are set to
true.
, the following occurs:
Instances with a public IP address receive corresponding public DNS hostnames.
The Amazon Route 53 Resolver server can resolve Amazon-provided private DNS hostnames.
If either or both of the attributes is set to
false.
, the following occurs:
Instances with a public IP address do not receive corresponding public DNS hostnames.
The Amazon Route 53 Resolver cannot resolve Amazon-provided private DNS hostnames.
Instances receive custom private DNS hostnames if there is a custom domain name in the DHCP options set.
If you are not using the Amazon Route 53 Resolver server, your custom domain name servers must resolve the hostname as appropriate.
Option B is incorrect because the DHCP options set is used if there is a custom domain name created by the user.
If you are not using the Amazon Route 53 Resolver server, your custom domain name servers must resolve the hostname as appropriate.
So there is no need to check the DHCP options set.
Default DHCP options set: AmazonProvidedDNS.
Option C is incorrect because it is mentioned that EC2 instance is enabled with Auto-assign public IP, auto-assign public IP defines whether you can have a public IP address for the EC2 you are launching.
If you launch EC2 in the public subnet, you can choose to have a public IP address or not.
Option D is incorrect.
Custom VPC provides an option to enable/disable DNS Hostnames as described above.
We provide a DNS server (the Amazon Route 53 Resolver) for your VPC.
To use your own DNS server, create a new set of DHCP options for your VPC.
For more information, see DHCP options sets for your VPC.Reference:
https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-viewing https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.htmlThe correct answer is A. Check whether attributes for DNS Hostnames and DNS Resolution are enabled for VP.
Explanation: When you create a custom VPC with public and private subnets, DNS resolution and DNS hostnames attributes are disabled by default. These attributes need to be enabled in order to resolve public DNS names to private IP addresses within the VPC.
Enabling DNS resolution allows Amazon-provided DNS servers to resolve public DNS names to their corresponding IP addresses within the VPC. Enabling DNS hostnames allows Amazon to provide unique DNS names for resources that are launched within the VPC.
To enable these attributes for the VPC:
Once DNS resolution and DNS hostnames are enabled, you can verify that the EC2 instance has a Public DNS name by navigating to the EC2 console, selecting the instance, and checking the Public DNS column.
Option B, checking DHCP options set, is not relevant to this scenario as it pertains to assigning IP addresses and network configuration to instances launched within the VPC.
Option C, setting auto-assign public IP to Use Subnet Setting, is also not relevant to this scenario as the EC2 instance already has auto-assign public IP enabled.
Option D, setting up EC2 instance in the default VPC, is not necessary as custom VPCs can support private DNS names with the appropriate attributes enabled.