3

My free tier EC2 instance (ubuntu 11.04, created last year) is expired. I just created a new one (ubuntu 12.04), but found that the new EC2 cannot resolve any hostname. By checking /etc/resolv.conf.

The old one looks like:

domain ap-northeast-1.compute.internal
search ap-northeast-1.compute.internal
nameserver 172.16.0.23

Where the new one looks like:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

Is the nameserver configuration not automatically set up now? How should I configure the nameserver, through the AWS console? Do I have to use Route 53? I would rather use a free solution if it's not too complicated to set up.

Stan
  • 1,387
  • 6
  • 24
  • 40
  • That is strange, `resolve.conf` should not be empty. Did you use the stock Ubuntu 12.04 AMI or did you use a community AMI to create your instance? – David Levesque Oct 10 '13 at 17:17
  • I picked the one from "quick start" list. AMI full name: Ubuntu Server 12.04.2 LTS. – Stan Oct 10 '13 at 18:28

3 Answers3

5

I was curious so I just launched an instance using AMI "Ubuntu Server 12.04.2 LTS" and I have this in resolv.conf:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 172.16.0.23
search us-west-2.compute.internal

So maybe something went wrong when you created your instance. Try launching a new one.

Edit: Since your instance is inside a VPC, try Creating a DHCP Options Set with domain-name-servers=AmazonProvidedDNS, then assign the options set to your VPC.

David Levesque
  • 3,543
  • 1
  • 19
  • 13
3

Here's what I appear to have observed: when I skipped the configure steps in the Create Wizard, my instance had an empty resolv.conf, but when I clicked through the steps (didn't change the defaults, just clicked through dutifully), then the resolution configuration had the nameserver in it.

Falcon Momot
  • 25,244
  • 15
  • 63
  • 92
sameers
  • 141
  • 4
1

Change the DNS options for your VPC. http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html You can add your private DNS there, and instead of adding the AWS DNS server, the DHCP update will put the addresses you have configured.

  • 3
    Please expand your answer to include relevant details from the link, so that when the content linked to disappears, your answer is still useful. – womble Aug 28 '15 at 23:29