AdguardTeam / AdguardTeam/AdGuardDNSCLI

[Feature Request] Ability to read and respect local system hosts file

Open
#12 0 comments 0 reactions 1 assignee Claimed by @Chinaski1 View on GitHub
feature request Priority: P4
Dominant language
Go
Stars
108
Forks
9
PR merge metrics
No merged PRs in 30d

Description

### Prerequisites

- [x] I have checked the [Knowledge Base](https://adguard-dns.io/kb/) and the [Discussions](https://github.com/AdguardTeam/AdGuardDNSClient/discussions) and found no answer

- [x] I have searched other issues and found no duplicates

- [x] I want to request a feature or enhancement and not ask a question

### The problem

### Problem Description
The AdGuard DNS Forwarder currently acts as a standalone DNS resolver/proxy that communicates directly with upstream servers. On Windows, this setup bypasses the local system `hosts` file (`C:\Windows\System32\drivers\etc\hosts`).

Many users and developers rely on the `hosts` file for local environment mapping, internal network routing, or quick local overrides. Currently, these entries are ignored unless they are manually duplicated into the AdGuard configuration, which is inefficient and prone to sync issues.

### Proposed solution

### Proposed Feature
I would like to request a feature that allows AdGuard DNS to read and serve entries from the local system `hosts` file. Ideally, the forwarder should look up the requested domain in the local `hosts` file before querying any external upstreams.

### Suggested Configuration
A simple implementation in the `dns` section of the YAML configuration would be ideal:

```yaml
dns:
hosts:
enabled: true
path: "C:\\Windows\\System32\\drivers\\etc\\hosts"
refresh_period: 5m

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.