# Android "Failed host lookup" error

When connecting to a location that uses an external OpenID provider, the Android app shows:

```
DioException [connection error]: The connection errored: Failed host lookup
```

<figure><img src="/files/bHUQJzchp1dAW9sx58XR" alt="" width="236"><figcaption></figcaption></figure>

This is caused by aggressive battery optimization on the Android device. When the app is in the background, the system restricts its network access, which breaks DNS resolution during the OpenID authentication flow.

### Fix

1. Go to **Settings** on your Android device.
2. Navigate to **Apps → App management → Defguard**.
3. Open **Battery usage**.
4. Enable **Allow background activity**.

The app will now retain network access while in the background during OpenID authentication.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.defguard.net/support-1/troubleshooting-guides/mobile-client/android-failed-host-lookup-error.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
