How to implement DHCP, DNS, hostnames on AWS VPC

amazon-vpcamazon-web-servicesdhcpinternal-dns

This is what I THINK can happen and what I want.

I create a VPC in Amazon, put a public subnet into it, put a puppet server instance and a full stack web server instance in the VPC.

Now I set the hostname for the puppet server 'puppet' and for the web server as 'webserver'.

I then set a DHCP option set with the domain name as 'my-company-name.com.local', Use Amazon provided DNS, and associate it with the VPC. I create a Zone record using Route 53 with the same domain name.

I then force the two instances to get new DHCP leases and VOILA! they get private IP addresses and DNS gets automatically updated for forward and reverse DNS lookups.

Now 'puppet.mycompany.com.local' can find 'webserver.mycompany.com.local' and visa versa within the private side of the networking in my VPC.

The two questions are:
A) Is that how DNS and DHCP work (especially the automatic cooperation between them)? I don't have to manually enter the DHCP assigned IP addresses in DNS records, do I?
B) How do I set this to work, most probably, what DNS records do I need to create and any other steps?

Best Answer

There are two approaches taken it seems. But backing up a second, THERE IS NO DYNAMIC DNS in Route 53, i.e. NO COOPERATION BETWEEN DHCP and DNS in VPCs on AWS.

Approach 1: http://www.ducea.com/2009/06/01/howto-update-dns-hostnames-automatically-for-your-amazon-ec2-instances/ (Requires a Bind9 dns server in the network)

Approach 2: http://cantina.co/automated-dns-for-aws-instances-using-route-53/ (requires a set of scripts and downloaded libs, plus puts an IAM Role credential allowing DNS updates ON EVERY SERVER IN YOUR SYSTEM. One hacked box and your network is toast.)

What am I going to do? I need to run puppet anyway, and TheForeman comes with Bind9 and a dhcp server included. So I will just dedicate an instance to that.

Related Topic