diff --git a/cluster/cluster_impl/base_cluster_invoker.go b/cluster/cluster_impl/base_cluster_invoker.go
index ced5b15cb9a1c2292ca866f6f7478ce2b23a30b9..d3552c9476324af09981df602c99146bfe206adc 100644
--- a/cluster/cluster_impl/base_cluster_invoker.go
+++ b/cluster/cluster_impl/base_cluster_invoker.go
@@ -22,7 +22,6 @@ import (
 )
 
 import (
-	gxnet "github.com/dubbogo/gost/net"
 	perrors "github.com/pkg/errors"
 	"go.uber.org/atomic"
 )
@@ -72,7 +71,7 @@ func (invoker *baseClusterInvoker) IsAvailable() bool {
 //check invokers availables
 func (invoker *baseClusterInvoker) checkInvokers(invokers []protocol.Invoker, invocation protocol.Invocation) error {
 	if len(invokers) == 0 {
-		ip, _ := gxnet.GetLocalIP()
+		ip := common.GetLocalIp()
 		return perrors.Errorf("Failed to invoke the method %v. No provider available for the service %v from "+
 			"registry %v on the consumer %v using the dubbo version %v .Please check if the providers have been started and registered.",
 			invocation.MethodName(), invoker.directory.GetUrl().SubURL.Key(), invoker.directory.GetUrl().String(), ip, constant.Version)
@@ -84,7 +83,7 @@ func (invoker *baseClusterInvoker) checkInvokers(invokers []protocol.Invoker, in
 //check cluster invoker is destroyed or not
 func (invoker *baseClusterInvoker) checkWhetherDestroyed() error {
 	if invoker.destroyed.Load() {
-		ip, _ := gxnet.GetLocalIP()
+		ip := common.GetLocalIp()
 		return perrors.Errorf("Rpc cluster invoker for %v on consumer %v use dubbo version %v is now destroyed! can not invoke any more. ",
 			invoker.directory.GetUrl().Service(), ip, constant.Version)
 	}
diff --git a/cluster/cluster_impl/failover_cluster_invoker.go b/cluster/cluster_impl/failover_cluster_invoker.go
index 4260a9324dd360ac24f80e425d8542a423c8815e..9d19152c15116ae8c25b8c30e8e7ef359ea5269c 100644
--- a/cluster/cluster_impl/failover_cluster_invoker.go
+++ b/cluster/cluster_impl/failover_cluster_invoker.go
@@ -24,12 +24,12 @@ import (
 )
 
 import (
-	gxnet "github.com/dubbogo/gost/net"
 	perrors "github.com/pkg/errors"
 )
 
 import (
 	"github.com/apache/dubbo-go/cluster"
+	"github.com/apache/dubbo-go/common"
 	"github.com/apache/dubbo-go/common/constant"
 	"github.com/apache/dubbo-go/common/logger"
 	"github.com/apache/dubbo-go/protocol"
@@ -89,7 +89,7 @@ func (invoker *failoverClusterInvoker) Invoke(ctx context.Context, invocation pr
 		return result
 	}
 
-	ip, _ := gxnet.GetLocalIP()
+	ip := common.GetLocalIp()
 	invokerSvc := invoker.GetUrl().Service()
 	invokerUrl := invoker.directory.GetUrl()
 	return &protocol.RPCResult{
diff --git a/cluster/directory/base_directory_test.go b/cluster/directory/base_directory_test.go
index a2b62dfa008e6cd17b1200d93cd235da17d03905..e51e533f2e27ac8fbb6e4b19e8a32e6be2025855 100644
--- a/cluster/directory/base_directory_test.go
+++ b/cluster/directory/base_directory_test.go
@@ -24,7 +24,6 @@ import (
 )
 
 import (
-	gxnet "github.com/dubbogo/gost/net"
 	"github.com/stretchr/testify/assert"
 )
 
@@ -55,7 +54,7 @@ func TestBuildRouterChain(t *testing.T) {
 
 	assert.NotNil(t, directory)
 
-	localIP, _ := gxnet.GetLocalIP()
+	localIP := common.GetLocalIp()
 	rule := base64.URLEncoding.EncodeToString([]byte("true => " + " host = " + localIP))
 	routeURL := getRouteURL(rule, anyURL)
 	routeURL.AddParam(constant.INTERFACE_KEY, "mock-app")
@@ -79,7 +78,7 @@ func TestIsProperRouter(t *testing.T) {
 	regURL := url
 	regURL.AddParam(constant.APPLICATION_KEY, "mock-app")
 	d := NewBaseDirectory(&regURL)
-	localIP, _ := gxnet.GetLocalIP()
+	localIP := common.GetLocalIp()
 	rule := base64.URLEncoding.EncodeToString([]byte("true => " + " host = " + localIP))
 	routeURL := getRouteURL(rule, anyURL)
 	routeURL.AddParam(constant.APPLICATION_KEY, "mock-app")
diff --git a/cluster/router/condition/factory_test.go b/cluster/router/condition/factory_test.go
index b31f6c7a82ea102c6e0b80d68e43f7b359785544..8fdfae7404e25179350bd2d2279bb0f1a21169fc 100644
--- a/cluster/router/condition/factory_test.go
+++ b/cluster/router/condition/factory_test.go
@@ -26,7 +26,6 @@ import (
 )
 
 import (
-	"github.com/dubbogo/gost/net"
 	perrors "github.com/pkg/errors"
 	"github.com/stretchr/testify/assert"
 )
@@ -164,7 +163,7 @@ func TestRoute_matchWhen(t *testing.T) {
 }
 
 func TestRoute_matchFilter(t *testing.T) {
-	localIP, _ := gxnet.GetLocalIP()
+	localIP := common.GetLocalIp()
 	t.Logf("The local ip is %s", localIP)
 	url1, _ := common.NewURL("dubbo://10.20.3.3:20880/com.foo.BarService?default.serialization=fastjson")
 	url2, _ := common.NewURL(fmt.Sprintf(factoryDubboFormat, localIP))
@@ -223,7 +222,7 @@ func TestRoute_methodRoute(t *testing.T) {
 
 func TestRoute_ReturnFalse(t *testing.T) {
 	url, _ := common.NewURL("")
-	localIP, _ := gxnet.GetLocalIP()
+	localIP := common.GetLocalIp()
 	invokers := []protocol.Invoker{NewMockInvoker(url, 1), NewMockInvoker(url, 2), NewMockInvoker(url, 3)}
 	inv := &invocation.RPCInvocation{}
 	rule := base64.URLEncoding.EncodeToString([]byte("host = " + localIP + " => false"))
@@ -234,7 +233,7 @@ func TestRoute_ReturnFalse(t *testing.T) {
 }
 
 func TestRoute_ReturnEmpty(t *testing.T) {
-	localIP, _ := gxnet.GetLocalIP()
+	localIP := common.GetLocalIp()
 	url, _ := common.NewURL("")
 	invokers := []protocol.Invoker{NewMockInvoker(url, 1), NewMockInvoker(url, 2), NewMockInvoker(url, 3)}
 	inv := &invocation.RPCInvocation{}
@@ -246,7 +245,7 @@ func TestRoute_ReturnEmpty(t *testing.T) {
 }
 
 func TestRoute_ReturnAll(t *testing.T) {
-	localIP, _ := gxnet.GetLocalIP()
+	localIP := common.GetLocalIp()
 	urlString := "dubbo://" + localIP + "/com.foo.BarService"
 	dubboURL, _ := common.NewURL(urlString)
 	mockInvoker1 := NewMockInvoker(dubboURL, 1)
@@ -262,7 +261,7 @@ func TestRoute_ReturnAll(t *testing.T) {
 }
 
 func TestRoute_HostFilter(t *testing.T) {
-	localIP, _ := gxnet.GetLocalIP()
+	localIP := common.GetLocalIp()
 	url1, _ := common.NewURL(factory333URL)
 	url2, _ := common.NewURL(fmt.Sprintf(factoryDubboFormat, localIP))
 	url3, _ := common.NewURL(fmt.Sprintf(factoryDubboFormat, localIP))
@@ -281,7 +280,7 @@ func TestRoute_HostFilter(t *testing.T) {
 }
 
 func TestRoute_Empty_HostFilter(t *testing.T) {
-	localIP, _ := gxnet.GetLocalIP()
+	localIP := common.GetLocalIp()
 	url1, _ := common.NewURL(factory333URL)
 	url2, _ := common.NewURL(fmt.Sprintf(factoryDubboFormat, localIP))
 	url3, _ := common.NewURL(fmt.Sprintf(factoryDubboFormat, localIP))
@@ -300,7 +299,7 @@ func TestRoute_Empty_HostFilter(t *testing.T) {
 }
 
 func TestRoute_False_HostFilter(t *testing.T) {
-	localIP, _ := gxnet.GetLocalIP()
+	localIP := common.GetLocalIp()
 	url1, _ := common.NewURL(factory333URL)
 	url2, _ := common.NewURL(fmt.Sprintf(factoryDubboFormat, localIP))
 	url3, _ := common.NewURL(fmt.Sprintf(factoryDubboFormat, localIP))
@@ -319,7 +318,7 @@ func TestRoute_False_HostFilter(t *testing.T) {
 }
 
 func TestRoute_Placeholder(t *testing.T) {
-	localIP, _ := gxnet.GetLocalIP()
+	localIP := common.GetLocalIp()
 	url1, _ := common.NewURL(factory333URL)
 	url2, _ := common.NewURL(fmt.Sprintf(factoryDubboFormat, localIP))
 	url3, _ := common.NewURL(fmt.Sprintf(factoryDubboFormat, localIP))
@@ -338,7 +337,7 @@ func TestRoute_Placeholder(t *testing.T) {
 }
 
 func TestRoute_NoForce(t *testing.T) {
-	localIP, _ := gxnet.GetLocalIP()
+	localIP := common.GetLocalIp()
 	url1, _ := common.NewURL(factory333URL)
 	url2, _ := common.NewURL(fmt.Sprintf(factoryDubboFormat, localIP))
 	url3, _ := common.NewURL(fmt.Sprintf(factoryDubboFormat, localIP))
@@ -355,7 +354,7 @@ func TestRoute_NoForce(t *testing.T) {
 }
 
 func TestRoute_Force(t *testing.T) {
-	localIP, _ := gxnet.GetLocalIP()
+	localIP := common.GetLocalIp()
 	url1, _ := common.NewURL(factory333URL)
 	url2, _ := common.NewURL(fmt.Sprintf(factoryDubboFormat, localIP))
 	url3, _ := common.NewURL(fmt.Sprintf(factoryDubboFormat, localIP))
diff --git a/cluster/router/condition/router.go b/cluster/router/condition/router.go
index 4267f5b405367950d38c5d7af705e663f4416602..48f2aae133e5c784570dc4b470766b431938efc4 100644
--- a/cluster/router/condition/router.go
+++ b/cluster/router/condition/router.go
@@ -25,7 +25,6 @@ import (
 import (
 	"github.com/RoaringBitmap/roaring"
 	"github.com/dubbogo/gost/container/set"
-	"github.com/dubbogo/gost/net"
 	perrors "github.com/pkg/errors"
 )
 
@@ -184,7 +183,7 @@ func (c *ConditionRouter) Route(invokers *roaring.Bitmap, cache router.Cache, ur
 		return result
 	} else if c.Force {
 		rule, _ := url.GetParamAndDecoded(constant.RULE_KEY)
-		localIP, _ := gxnet.GetLocalIP()
+		localIP := common.GetLocalIp()
 		logger.Warnf("The route result is empty and force execute. consumer: %s, service: %s, router: %s", localIP, url.Service(), rule)
 		return result
 	}
diff --git a/common/host_util.go b/common/host_util.go
new file mode 100644
index 0000000000000000000000000000000000000000..9861c92bee15624dd79e02a6e3aba6b443dbd7da
--- /dev/null
+++ b/common/host_util.go
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package common
+
+import gxnet "github.com/dubbogo/gost/net"
+
+var localIp string
+
+func GetLocalIp() string {
+	if len(localIp) != 0 {
+		return localIp
+	}
+	localIp, _ = gxnet.GetLocalIP()
+	return localIp
+}
diff --git a/common/host_util_test.go b/common/host_util_test.go
new file mode 100644
index 0000000000000000000000000000000000000000..ad96dde4c77667a940c27455262a6aeca921a73d
--- /dev/null
+++ b/common/host_util_test.go
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package common
+
+import (
+	"testing"
+)
+
+import (
+	"github.com/stretchr/testify/assert"
+)
+
+func TestGetLocalIp(t *testing.T) {
+	assert.NotNil(t, GetLocalIp())
+}
diff --git a/config/config_loader.go b/config/config_loader.go
index c66e526921e7e5ab017105e2f4ea2baa62563205..f2102249c6e835c62e69613388bdd0c3dc4c750a 100644
--- a/config/config_loader.go
+++ b/config/config_loader.go
@@ -28,7 +28,6 @@ import (
 )
 
 import (
-	gxnet "github.com/dubbogo/gost/net"
 	perrors "github.com/pkg/errors"
 )
 
@@ -250,7 +249,7 @@ func createInstance(url common.URL) (registry.ServiceInstance, error) {
 
 	host := url.Ip
 	if len(host) == 0 {
-		host, err = gxnet.GetLocalIP()
+		host = common.GetLocalIp()
 		if err != nil {
 			return nil, perrors.WithMessage(err, "could not get the local Ip")
 		}
diff --git a/config/service_config_test.go b/config/service_config_test.go
index 4d4122ee7057043af47aa0400ca8c5b5e9a20cd0..61c8864b6ab7eb146a92e76187cd6363bbdb8dc8 100644
--- a/config/service_config_test.go
+++ b/config/service_config_test.go
@@ -18,11 +18,11 @@
 package config
 
 import (
+	"github.com/apache/dubbo-go/common"
 	"testing"
 )
 
 import (
-	gxnet "github.com/dubbogo/gost/net"
 	"github.com/stretchr/testify/assert"
 	"go.uber.org/atomic"
 )
@@ -184,7 +184,7 @@ func TestExport(t *testing.T) {
 func TestGetRandomPort(t *testing.T) {
 	protocolConfigs := make([]*ProtocolConfig, 0, 3)
 
-	ip, err := gxnet.GetLocalIP()
+	ip := common.GetLocalIp()
 	protocolConfigs = append(protocolConfigs, &ProtocolConfig{
 		Ip: ip,
 	})
@@ -194,7 +194,7 @@ func TestGetRandomPort(t *testing.T) {
 	protocolConfigs = append(protocolConfigs, &ProtocolConfig{
 		Ip: ip,
 	})
-	assert.NoError(t, err)
+	//assert.NoError(t, err)
 	ports := getRandomPort(protocolConfigs)
 
 	assert.Equal(t, ports.Len(), len(protocolConfigs))
diff --git a/config_center/configurator/override.go b/config_center/configurator/override.go
index ec4e606e0dff300729e2a2bc56f510db94ea9f26..7f5abb6175056b44a5d9c6a9fa527ad6e9ac6791 100644
--- a/config_center/configurator/override.go
+++ b/config_center/configurator/override.go
@@ -23,7 +23,6 @@ import (
 
 import (
 	gxset "github.com/dubbogo/gost/container/set"
-	gxnet "github.com/dubbogo/gost/net"
 )
 
 import (
@@ -61,7 +60,7 @@ func (c *overrideConfigurator) Configure(url *common.URL) {
 		currentSide := url.GetParam(constant.SIDE_KEY, "")
 		configuratorSide := c.configuratorUrl.GetParam(constant.SIDE_KEY, "")
 		if currentSide == configuratorSide && common.DubboRole[common.CONSUMER] == currentSide && c.configuratorUrl.Port == "0" {
-			localIP, _ := gxnet.GetLocalIP()
+			localIP := common.GetLocalIp()
 			c.configureIfMatch(localIP, url)
 		} else if currentSide == configuratorSide && common.DubboRole[common.PROVIDER] == currentSide && c.configuratorUrl.Port == url.Port {
 			c.configureIfMatch(url.Ip, url)
@@ -127,7 +126,7 @@ func (c *overrideConfigurator) configureDeprecated(url *common.URL) {
 		// 1.If it is a consumer ip address, the intention is to control a specific consumer instance, it must takes effect at the consumer side, any provider received this override url should ignore;
 		// 2.If the ip is 0.0.0.0, this override url can be used on consumer, and also can be used on provider
 		if url.GetParam(constant.SIDE_KEY, "") == common.DubboRole[common.CONSUMER] {
-			localIP, _ := gxnet.GetLocalIP()
+			localIP := common.GetLocalIp()
 			c.configureIfMatch(localIP, url)
 		} else {
 			c.configureIfMatch(constant.ANYHOST_VALUE, url)
diff --git a/registry/base_registry.go b/registry/base_registry.go
index e7d38df067b7081a9866651dbb1b41e4eebd256b..fe61ab173e74575a2c725226c3830c2b65417327 100644
--- a/registry/base_registry.go
+++ b/registry/base_registry.go
@@ -29,7 +29,6 @@ import (
 )
 
 import (
-	gxnet "github.com/dubbogo/gost/net"
 	perrors "github.com/pkg/errors"
 )
 
@@ -53,7 +52,7 @@ var (
 
 func init() {
 	processID = fmt.Sprintf("%d", os.Getpid())
-	localIP, _ = gxnet.GetLocalIP()
+	localIP = common.GetLocalIp()
 }
 
 type createPathFunc func(dubboPath string) error
diff --git a/registry/consul/utils.go b/registry/consul/utils.go
index 05ac5e76e292a2b574bd5e661bbbcca4f419fc22..f5babf69d5970a495f8f0c23a254fe4b2a9ffbee 100644
--- a/registry/consul/utils.go
+++ b/registry/consul/utils.go
@@ -25,7 +25,6 @@ import (
 )
 
 import (
-	gxnet "github.com/dubbogo/gost/net"
 	consul "github.com/hashicorp/consul/api"
 	perrors "github.com/pkg/errors"
 )
@@ -47,7 +46,7 @@ func buildService(url common.URL) (*consul.AgentServiceRegistration, error) {
 
 	// address
 	if url.Ip == "" {
-		url.Ip, _ = gxnet.GetLocalIP()
+		url.Ip = common.GetLocalIp()
 	}
 
 	// port
diff --git a/registry/directory/directory.go b/registry/directory/directory.go
index 5d4a890c6e2f59107a1dff3fc09ebf2c37777d56..6f9c4fc889ddfd4b9949cc3115310e122678310e 100644
--- a/registry/directory/directory.go
+++ b/registry/directory/directory.go
@@ -25,7 +25,6 @@ import (
 )
 
 import (
-	gxnet "github.com/dubbogo/gost/net"
 	perrors "github.com/pkg/errors"
 	"go.uber.org/atomic"
 )
@@ -365,7 +364,7 @@ func (dir *RegistryDirectory) overrideUrl(targetUrl *common.URL) {
 
 func (dir *RegistryDirectory) getConsumerUrl(c *common.URL) *common.URL {
 	processID := fmt.Sprintf("%d", os.Getpid())
-	localIP, _ := gxnet.GetLocalIP()
+	localIP := common.GetLocalIp()
 
 	params := url.Values{}
 	c.RangeParams(func(key, value string) bool {
diff --git a/registry/kubernetes/registry.go b/registry/kubernetes/registry.go
index 88895855689df42f2cd66ec158e6b8f2806ef6f0..c1e559e48dcc64972c9405e15405d7e6febcc845 100644
--- a/registry/kubernetes/registry.go
+++ b/registry/kubernetes/registry.go
@@ -27,7 +27,6 @@ import (
 
 import (
 	"github.com/apache/dubbo-getty"
-	"github.com/dubbogo/gost/net"
 	perrors "github.com/pkg/errors"
 	v1 "k8s.io/api/core/v1"
 )
@@ -54,7 +53,7 @@ const (
 
 func init() {
 	processID = fmt.Sprintf("%d", os.Getpid())
-	localIP, _ = gxnet.GetLocalIP()
+	localIP = common.GetLocalIp()
 	extension.SetRegistry(Name, newKubernetesRegistry)
 }
 
diff --git a/registry/nacos/registry.go b/registry/nacos/registry.go
index 757474455b7e5df6e5fb454228cdcb551b6a3a0e..51428864fbe45aac6257d7fc1f68abcf53f638f1 100644
--- a/registry/nacos/registry.go
+++ b/registry/nacos/registry.go
@@ -26,7 +26,6 @@ import (
 )
 
 import (
-	gxnet "github.com/dubbogo/gost/net"
 	"github.com/nacos-group/nacos-sdk-go/clients"
 	"github.com/nacos-group/nacos-sdk-go/clients/naming_client"
 	nacosConstant "github.com/nacos-group/nacos-sdk-go/common/constant"
@@ -52,7 +51,7 @@ const (
 )
 
 func init() {
-	localIP, _ = gxnet.GetLocalIP()
+	localIP = common.GetLocalIp()
 	extension.SetRegistry(constant.NACOS_KEY, newNacosRegistry)
 }