diff --git a/pkg/net/fqdn/fqdn.go b/pkg/net/fqdn/fqdn.go index 883bb8533d9..8cb3afc4511 100644 --- a/pkg/net/fqdn/fqdn.go +++ b/pkg/net/fqdn/fqdn.go @@ -17,7 +17,11 @@ package fqdn import ( + "os" + "github.com/Showmax/go-fqdn" + + logger "d7y.io/dragonfly/v2/internal/dflog" ) var FQDNHostname string @@ -30,7 +34,13 @@ func init() { func fqdnHostname() string { fqdn, err := fqdn.FqdnHostname() if err != nil { - panic(err) + logger.Warnf("can not found fqdn: %s", err.Error()) + hostname, err := os.Hostname() + if err != nil { + panic(err) + } + + return hostname } return fqdn