---
title: Incorrect host name reported
source: https://docs.newrelic.com/docs/infrastructure/infrastructure-troubleshooting/troubleshoot-infrastructure/incorrect-host-name-reported
---

## Problem [#problem]

The agent is working, but the [infrastructure UI](https://docs.newrelic.com/docs/infrastructure/infrastructure-ui-pages/infra-hosts-ui-page) shows the wrong hostname or duplicated hosts appear.

## Solution [#solution]

Review the [hostname](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/configuration/infrastructure-agent-configuration-settings/#hostname-variables) related settings in the agent configuration.
To set the correct hostname, try the following steps:

1.  Edit the [`newrelic-infra.yml`](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/configuration/configure-infrastructure-agent#config-file) configuration file and add the `override_hostname` option, whose value is your expected hostname. For example:

    ```yml
    override_hostname: correct-host.domain.com
    ```
2.  Use [your init system](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/configuration/start-stop-restart-check-infrastructure-agent-status#init-system) to restart the agent service:

    **Restart the agent with SystemD**

    Use SystemD commands with CentOS 7, Debian 8, RHEL 7, and Ubuntu 15.04 or higher:

    ````sh
    sudo systemctl restart newrelic-infra
    ```

    ````

    **Restart the agent with System V**

    Use System V commands with Debian 7:

    ````sh
    sudo /etc/init.d/newrelic-infra restart
    ```

    ````

    **Restart the agent with Upstart**

    Use Upstart commands with Amazon Linux, CentOS 6, RHEL 6, and Ubuntu 14.10 or lower:

    ````sh
    sudo initctl restart newrelic-infra
    ```

    ````

    **Restart the agent in Windows**

    ````sh
    net stop newrelic-infra
    net start newrelic-infra
    ```

    ````

## Cause [#cause]

In Linux and macOS, the New Relic infrastructure agent tries to resolve its [fully qualified domain name](https://en.wikipedia.org/wiki/Fully_qualified_domain_name) against a domain name server, which may not be properly configured or not controlled by the same user as the New Relic infrastructure agent. In Windows, it resolves the domain name using internal tools.
