If you are using /etc/hosts files instead of DNS-based lookups and your hosts files have FQDNs, you must ensure that the FQDN includes a trailing dot. Thus a correct hosts file entry for foo.example.com may look like this.
1.2.3.4 foo.example.com foo.example.com. foo
The Hadoop host resolver ensures hostnames are terminated with a trailing dot prior to lookup to avoid the security issue described in RFC 1535.
From https://github.com/TOSIT-IO/tdp-collection/issues/440#issue-1362257506.
Documentation https://cwiki.apache.org/confluence/display/HADOOP2/UnknownHost: