Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon RDS: Custom resolv.conf within EC2 breaks connectivity

We override the default resolv.conf within our EC2 instance, replacing both the nameservers and the search. However, this seems to break connection with RDS. If I revert back to the default EC2 resolv.conf, everything works fine. I'm not much of a sysadmin, so I'm a bit unsure as to how to work around this. Any ideas?

like image 297
rpaddock Avatar asked Dec 07 '25 02:12

rpaddock


1 Answers

We had a similar issue and have used the "resolvconf" package (as its named in Ubuntu at least)

http://packages.debian.org/sid/resolvconf

To keep our custom changes in sync.

What it looks is happening is that an EC2 instance will do a DHCP refresh and even though EC2 says your internal IP wont change a by-product of this refresh is that it overwrites /etc/resolv.conf - there by frying any of your changes. If you use resolvconf and configure ITS configuration with your custom changes, then upon a refresh it will merge your changes plus what it gets from the DHCP and write it back to /etc/resolv.conf which preserves your customizations.

Works for us pretty well.

like image 148
Cody Caughlan Avatar answered Dec 09 '25 03:12

Cody Caughlan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!