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, 2020 in AWS by akhtar
• 38,230 points
1,398 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, 2020 by MD
• 95,440 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
• 58,090 points
712 views
0 votes
1 answer

Using Shapely on AWS Lambda with Python 3

For some reason, the pip install of ...READ MORE

answered Oct 8, 2018 in AWS by Priyaj
• 58,090 points
2,594 views
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 Nov 20, 2020 in AWS by MD
• 95,440 points
582 views
0 votes
1 answer

How to measure the total size of an S3 bucket using python?

Hi@akhtar, You can do this tasks using Boto. ...READ MORE

answered Apr 15, 2020 in AWS by MD
• 95,440 points
5,188 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP