Set 127.0.1.1 to resolve for only ip4-loopback
#742
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
as resolving
localhost
to127.0.1.1
causes bad things in certain situations. Yes, it can happen.See https://www.traviscistatus.com/incidents/11hp8bhkrkn7
moar info
When there are multiple matches for a host name in
/etc/hosts
, Ruby'sResolv::Defaultresolver.getaddress
returns the last one (https://github.com/ruby/ruby/blob/bfe6bd0f72a58196969ad7dbdf409fe4573c5eea/lib/resolv.rb#L211).This is bad news for some software, notably mongoid, as it sends connections to an address to which MongoDB is not bound. We avoid this problem by not assigning multiple addresses to
our host names. We still need 127.0.1.1 (See http://serverfault.com/a/363098), so
we assign a single name to this numeric IP address.