AdguardTeam / AdguardTeam/AdGuardHome

DNS Rewrites: Mix subdomain and CNAME wildcard

Open
#7,063 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
36.9k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

### Prerequisites

- [X] I have checked the [Wiki](https://github.com/AdguardTeam/AdGuardHome/wiki) and [Discussions](https://github.com/AdguardTeam/AdGuardHome/discussions/categories/q-a) and found no answer

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

- [X] I want to report a bug and not [ask a question or ask for help](https://github.com/AdguardTeam/AdGuardHome/discussions/categories/q-a)

- [X] I have set up AdGuard Home correctly and [configured clients to use it](https://github.com/AdguardTeam/AdGuardHome/wiki/Clients). (Use the [Discussions](https://github.com/AdguardTeam/AdGuardHome/discussions/categories/q-a) for help with installing and configuring clients.)

### Platform (OS and CPU architecture)

Darwin (aka macOS), AMD64 (aka x86_64)

### Installation

Other (please mention in the description)

### Setup

On one machine

### AdGuard Home version

0.107.50

### Action

Run AdguardHome from terminal, bind to 0.0.0.0:53, leave the rest default, then add 3 following DSN Rewrites.

```conf
abc.home 1.1.1.1
*.abc.home abc.home
x.abc.home 2.2.2.2
```

```sh
dig x.abc.home 127.0.0.1
```

### Expected result

```
; <<>> DiG 9.10.6 <<>> x.abc.home 127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10398
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;x.abc.home. IN A

;; ANSWER SECTION:
x.abc.home. 10 IN A 2.2.2.2
```

### Actual result

```
; <<>> DiG 9.10.6 <<>> x.abc.home 127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38526
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;x.abc.home. IN A

;; ANSWER SECTION:
x.abc.home. 10 IN CNAME abc.home.
abc.home. 10 IN A 1.1.1.1
```

### Additional information and/or screenshots

If `*.abc.home` value is set to IP instead of CNAME as following, then the result will be correct as expected.

```conf
abc.home. 1.1.1.1
*.abc.home 1.1.1.1
x.abc.home. 2.2.2.2
```

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.