diff --git a/libnetwork/resolver.go b/libnetwork/resolver.go
index <HASH>..<HASH> 100644
--- a/libnetwork/resolver.go
+++ b/libnetwork/resolver.go
@@ -87,6 +87,7 @@ type resolver struct {
 	listenAddress string
 	proxyDNS      bool
 	resolverKey   string
+	startCh       chan struct{}
 }
 
 func init() {
@@ -101,6 +102,7 @@ func NewResolver(address string, proxyDNS bool, resolverKey string, backend DNSB
 		listenAddress: address,
 		resolverKey:   resolverKey,
 		err:           fmt.Errorf("setup not done yet"),
+		startCh:       make(chan struct{}, 1),
 	}
 }
 
@@ -136,6 +138,9 @@ func (r *resolver) SetupFunc(port int) func() {
 }
 
 func (r *resolver) Start() error {
+	r.startCh <- struct{}{}
+	defer func() { <-r.startCh }()
+
 	// make sure the resolver has been setup before starting
 	if r.err != nil {
 		return r.err
@@ -160,6 +165,9 @@ func (r *resolver) Start() error {
 }
 
 func (r *resolver) Stop() {
+	r.startCh <- struct{}{}
+	defer func() { <-r.startCh }()
+
 	if r.server != nil {
 		r.server.Shutdown()
 	}
Serialize embedded resolver Start and Stop