Skip to content

Commit d7c0486

Browse files
committed
Use rabbit_net:hostname
This will take into account error conditions which will default to the value returned by inet:gethostname()
1 parent 3b4af50 commit d7c0486

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/rabbit_nodes.erl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ cluster_name() ->
7373

7474
cluster_name_default() ->
7575
{ID, _} = parts(node()),
76-
{ok, Host} = inet:gethostname(),
77-
{ok, #hostent{h_name = FQDN}} = inet:gethostbyname(Host),
76+
FQDN = rabbit_net:hostname(),
7877
list_to_binary(atom_to_list(make({ID, FQDN}))).
7978

8079
set_cluster_name(Name, Username) ->

0 commit comments

Comments
 (0)