Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching private IPs in /etc/hosts #4

Open
nicpottier opened this issue Oct 28, 2016 · 2 comments
Open

Caching private IPs in /etc/hosts #4

nicpottier opened this issue Oct 28, 2016 · 2 comments

Comments

@nicpottier
Copy link

Hey hey, ran into this when I got bit by AWS's DNS blowing up as well.

Looks close to what we need, but wondering how you are resolving the RDS private IPs since that seems related (and I gather from your blog post comments you also rely on RDS).

Just switching the resolv to Google's DNS will get you public IPs no? Will that fly?

Wondering whether another solution would be to "cache" the private ips for a configurable set of hosts and then write those to /etc/hosts when the primary DNS fails.

Thoughts? If I added this would you be interested? Alternatively how do you deal with this?

@kvz
Copy link
Owner

kvz commented Nov 1, 2016

We can also connect to public IP, but that might not fly depending on your setup indeed. It's worth testing though, since that would solve a lot of complexity.

If it doesn't, writing to /etc/hosts also is the first thing that comes to my mind without introducing many more moving parts / servers that will just add more vulnerable links to your chain.

I do worry a bit about atomicity (what If I'm also making a change to /etc/hosts using vim or ansible or aws is doing so via cloud-init for instance). It seems hard to do this is a failsafe way (not impossible).

@nicpottier
Copy link
Author

I might be down with using the public IP in those rare cases. Did you manage to get a security group rule that restricted it to just your security group? Haven't managed to do that since I think once you go to the public IP you are treated as any other public traffic incoming. Definitely don't want RDS open to the world.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants