On a "modern" system, you can use systemd-resolve.
From its man page:
systemd-resolve may be used to resolve domain names, IPv4 and IPv6
addresses, DNS resource records and services with the
systemd-resolved.service(8) resolver service. By
default, the specified list of parameters will be resolved as hostnames, retrieving their IPv4 and IPv6 addresses. If the parameters
specified are formatted as IPv4 or
IPv6 operation the reverse operation is done, and a hostname is retrieved for the specified addresses.
It will do DNS, whereas getent, depending on nsswitch.conf may not even do DNS queries.
You can also pass a --type option to have access to any kind of DNS record type.