For Agent 6, there are differences in hostname resolution. For more information, see differences in hostname resolution between Agent v5 and Agent v6.
The Datadog Agent collects potential host names from many 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 the name is recognized as obviously non-unique (like localhost.localdomain), the current rule fails and passes through to the next.
When pulling information on your AWS hosts from the Datadog API, the following attributes display based on availability:
||The instance id, fallback on host if no instance id|
||The canonical hostname (value of host identifier)|
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 List. See the list of aliases associated with each host in the Inspect panel, which is accessed by clicking the “Inspect” button while hovering over a host row: