---
title: Network connectivity issues
source: https://docs.newrelic.com/docs/infrastructure/infrastructure-troubleshooting/troubleshoot-infrastructure/network-connection-issues
---

## Problem [#problem]

The infrastructure agent is experiencing network issues connecting to New Relic endpoints.
Connectivity errors such as `Collector endpoint not reachable` or `Timeout exceeded while awaiting headers` appear on the agent logs.

## Solution [#solution]

Verify that the New Relic infrastructure agent endpoints are reachable from the host where it's installed.
Follow the instructions below to confirm there are no issues with your environment's network settings:

**Windows**

In your terminal, run the following command:

````bash
Invoke-WebRequest -Uri "https://infra-api.newrelic.com/cdn-cgi/trace"
```

The expected output should include a `200 (OK)` as shown below:

```json
StatusCode        : 200
StatusDescription : OK
Content           : fl=367f145
                    h=infra-api.newrelic.com
                    ip=XX.YY.ZZ.ZZ
                    ts=1696347189.607
                    visit_scheme=https
                    uag=Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.22621.963
                    colo=MAD
                    sliver=none
                    htt...
RawContent        : HTTP/1.1 200 OK
                    Transfer-Encoding: chunked
                    Connection: keep-alive
                    Access-Control-Allow-Origin: *
                    CF-RAY: 81063def0905384e-MAD
                    X-Frame-Options: DENY
                    X-Content-Type-Options: nosniff
                    Cache-Control...
Forms             : {}
Headers           : {[Transfer-Encoding, chunked], [Connection, keep-alive], [Access-Control-Allow-Origin, *], [CF-RAY, 81063def0905384e-MAD]...}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : System.__ComObject
RawContentLength  : 284
```

````

**Linux**

1.  **Resolve the domain:** Use `nslookup` or `dig` to validate that the Linux system can resolve the domain to an IP address:

    ```bash
    nslookup infra-api.newrelic.com
    ```

    The output should contain a name and IP address.

2.  **Ping the server:** Try pinging the IP address obtained above to ensure you can reach the server.

    ```bash
    ping 162.247.241.2
    ```

    The server should be reachable.

3.  **Traceroute:** Use `traceroute` to check the network path between your system and the server:

    ```bash
    traceroute -I infra-api.newrelic.com
    ```

    Analyze the output to identify potential network issues, such as high latency or packet loss.

4.  **Curl:** Use `curl` to check if the endpoint is reachable:

    ```bash
    curl -v https://infra-api.newrelic.com/cdn-cgi/trace

    fl=366f101
    h=infra-api.newrelic.com
    ip=XX.YY.ZZ.ZZ
    ts=1696347098.76
    visit_scheme=https
    uag=curl/7.88.1
    colo=MAD
    sliver=none
    http=http/1.1
    loc=ES
    tls=TLSv1.3
    sni=plaintext
    warp=off
    gateway=off
    rbi=off
    kex=X25519
    * Connection #0 to host infra-api.newrelic.com left intact
    ```

## Troubleshoot with NRDiag [#nrdiag]

New Relic diagnostics tool `NRDiag` is a utility that can also be used to automatically detects network problems.
Follow these steps to run the infrastructure agent connection test:

1.  Follow the [getting started](https://docs.newrelic.com/docs/new-relic-solutions/solve-common-issues/diagnostics-cli-nrdiag/diagnostics-cli-nrdiag/#get-started) steps to install `NRDiag` on your host.

2.  Run the infrastructure agent connect test.

    ```bash
    ./nrdiag -t Infra/Agent/Connect
    ```

3.  Validate the results, the expected output should look like the report below:

    ```bash
    Check Results
    -------------------------------------------------
    Info     Base/Env/CollectEnvVars [Gathered Environment variables of current shell.]
    Success  Base/Config/Collect
    Success  Base/Config/Validate
    Success  Base/Config/LicenseKey
    Success  Base/Config/ValidateLicenseKey
    Success  Infra/Config/Agent
    Success  Infra/Agent/Connect
    3 results not shown: 3 None
    See nrdiag-output.json for full results.
    ```

    Note that the `nrdiag Connect` task result is shown in `stdout`, it should also be collected with the `nrdiag_output.zip` file.

## Additional resources [#resources]

Refer to the technical documentation in the infrastructure agent [Github repo](https://github.com/newrelic/infrastructure-agent/blob/master/docs/network_troubleshooting.md) for more information.
