Zend certified PHP/Magento developer

ping and getent hosts give different result

I have entry in /etc/hosts

1.1.1.1 db_external

When I am doing ping I get it correct

ping db_external
PING db_external (1.1.1.1)

When I am doing

getent hosts db_external 

for some reason I got :

::1             db_external.localhost

What can be reason in that?

cat /etc/nsswitch.conf|grep hosts
#hosts:     db files nisplus nis dns
hosts:      files dns myhostname

Vult cloud image of centos 7

ps getent ahostsv4 or getent ahosts – works. But I have many entries in software with getent hosts