diff --git a/CHANGELOG.md b/CHANGELOG.md index 5abc9873e0..883830f5cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 0.7.0-rc.6 (2016-04-10) +- Flush cached resolver socket on default gateway change + ## 0.7.0-rc.5 (2016-04-08) - Persist ipam driver options - Fixes https://github.com/docker/libnetwork/issues/1087 diff --git a/endpoint.go b/endpoint.go index 55b3a8e1ab..7608dd7457 100644 --- a/endpoint.go +++ b/endpoint.go @@ -477,6 +477,10 @@ func (ep *endpoint) sbJoin(sb *sandbox, options ...EndpointOption) error { ep.Name(), ep.ID(), err) } } + + if sb.resolver != nil { + sb.resolver.FlushExtServers() + } } if !sb.needDefaultGW() { diff --git a/resolver.go b/resolver.go index a54a967770..cff692fd1f 100644 --- a/resolver.go +++ b/resolver.go @@ -158,6 +158,10 @@ func (r *resolver) Start() error { func (r *resolver) FlushExtServers() { for i := 0; i < maxExtDNS; i++ { + if r.extDNSList[i].extConn != nil { + r.extDNSList[i].extConn.Close() + } + r.extDNSList[i].extConn = nil r.extDNSList[i].extOnce = sync.Once{} }