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.

2
  • 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? Oct 10, 2013 at 17:17
  • I picked the one from "quick start" list. AMI full name: Ubuntu Server 12.04.2 LTS.
    – Stan
    Oct 10, 2013 at 18:28

3 Answers 3

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.

4
  • My resolv.conf is same as yours. But after rebooting the instance in the AWS console, the resolv.conf is gone. How can I get it back?
    – Stan
    Oct 10, 2013 at 20:16
  • Is your instance inside a VPC? Oct 10, 2013 at 20:37
  • Yes, it got a VPC id.
    – Stan
    Oct 11, 2013 at 2:10
  • See my edit about VPC. Oct 11, 2013 at 3:18
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.

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.

1
  • 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, 2015 at 23:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .