How to enable the Public DNS Hostname?

0 votes

Hi Guys,

I have created a VPC in AWS using the Boto3 module. Now I want to enable the Public DNS Hostname. How can I do with the Boto3 module?

Oct 9 in AWS by akhtar
• 33,470 points
78 views

1 answer to this question.

0 votes

Hi@akhtar,

we can also enable the Public DNS Hostnames by calling the client method of boto3 library and then accessing the modify_vpc_attribute() method, so that we can access the public DNS names of the EC2 instance we would be creating in this VPC. 

ec2Client = boto3.client('ec2')
ec2Client.modify_vpc_attribute( VpcId = vpc.id , EnableDnsSupport = { 'Value': True } )
ec2Client.modify_vpc_attribute( VpcId = vpc.id , EnableDnsHostnames = { 'Value': True } )
answered Oct 9 by MD
• 79,390 points

Related Questions In AWS

+1 vote
1 answer

Can we use AWS Public DNS as Domian name to enable https on our instance

I don't believe you can get a ...READ MORE

answered Aug 23, 2018 in AWS by Priyaj
• 57,700 points
132 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to download the public key of an asymmetric CMK in AWS KMS?

Hi@akhtar, The following get-public-key example downloads the public key of ...READ MORE

answered 6 days ago in AWS by MD
• 79,390 points
16 views
0 votes
1 answer