[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15506904#comment-15506904
 ] 

Scott Thompson commented on ZOOKEEPER-2596:
-------------------------------------------

I am unsure as to why any domain information is being returned by gethostname 
in this situation.  I built a small test application that calls gethostname 
subroutine on the same server and as expected only the machine name is 
returned.  However, host.name is populated with machine.domain.com in the logs 
from the code snippet in the description.

> Zookeeper.c - gethostname drops subdomain returning only partial FQDN
> ---------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-2596
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2596
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: c client
>         Environment: RedHat Enterprise Server 7.2
>            Reporter: Scott Thompson
>            Priority: Minor
>
> Nodes fail to connect when a sub-domain is present in the FQDN.
> The sub-domain is dropped from the hostname string when calling gethostname 
> in zookeeper.c.
> machine.sub.domain.com
> becomes
> machine.domain.com
> #ifdef HAVE_GETHOSTNAME
>   gethostname(buf, sizeof(buf));
>   LOG_INFO(LOGCALLBACK(zh), "Client environment:host.name=%s", buf);



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to