Skip to content

Commit a6a546f

Browse files
Merge pull request #1580 from rabbitmq/lrb-more-forgiving-hostname-lookup
Use rabbit_net:hostname
2 parents 3b4af50 + d7c0486 commit a6a546f

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)