For Agent 6, some differences in hostname resolution apply. See the documentation on differences in hostname resolution between Agent v5 and Agent v6.
The Datadog Agent collects potential hostnames from a number of different sources. To see all the names the Agent is detecting, run the Agent status command. For example:
$ sudo /etc/init.d/datadog-agent status ... Hostnames ========= hostname: my.special.hostname agent-hostname: my.special.hostname ec2-hostname: ip-192-0-0-1.internal instance-id: i-deadbeef socket-hostname: myhost socket-fqdn: myhost.mydomain ...
From these names, a canonical name is picked for the host. This is the name the Agent primarily uses to identify itself to Datadog. The other names are submitted as well, but only as candidates for aliasing.
The canonical hostname is picked according to the following rules. The first match is selected.
If name is recognized as obviously non-unique (e.g. localhost.localdomain), the current rule fails and passes through to the next.
A single host running in EC2 might have an instance ID (i-abcd1234), a generic hostname provided by EC2 based on the host’s IP address (ip-192-0-0-1), and a meaningful hostname provided by an internal DNS server or a config-managed hosts file (myhost.mydomain). Datadog creates aliases for hostnames when there are multiple uniquely identifiable names for a single host.
The names collected by the Agent (detailed above) are added as aliases for the chosen canonical name.
See a list of all the hosts in your account from the Infrastructure tab in Datadog. From the Inspect panel, which you get to by clicking the “Inspect” button while hovering over a host row, see (among other things) the list of aliases associated with each host.