AWS:EC2 enable dns-hostname for host in non default vpc
11,414
Solution 1
To enable DNS resolution and DNS hostnames for your VPC, open the VPC Management Console > Your VPCs. Click on your VPC and then click on Actions and then enable both Edit DNS Resolution & Edit DNS Hostnames.
Solution 2
DNS resolution is on a per-VPC basis, not per-instance. You can enable DNS hostnames by finding the VPC in the VPC management console and Enabling DNS hostname support.
Related videos on Youtube
Author by
Jens Zastrow
Updated on June 04, 2022Comments
-
Jens Zastrow almost 2 years
I have a non-default vpc where i want to launch instances. The docs http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-vpc.html say:
Non-default vpc: "DNS hostnames are disabled by default."
Currently there is no option to set in during ec2-launch with "aws ec2 run-instances".
http://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html
Any idea?
-
mTheSame about 4 yearsWhen this option is disabled, would this prevent dns resolution within the VPC?
-
captainblack about 4 yearsIf 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-provided DNS server 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-provided DNS server, your custom domain name servers must resolve the hostname as appropriate.
-
mTheSame about 4 yearsI'm facing some issues with private DNS, when I
dig
any address within the VPC (non-default), I don't get aanswer section
. I've tried to resolve the names from the default VPC, and I works. I've read in some AWS articles that I can't prevent DNS server access by Security Groups, ACL ou prevent routes to it. But what could be the problem?