AdguardTeam / AdguardTeam/AdGuardHome

Malformed question from `$dnsrewrite` rules for DHCP hostnames

Aperta
#8,068 0 commenti 0 reazioni 1 assegnatario Rivendicata da @EugeneOne1 Vedi su GitHub
bug P3: Medium
Lingua principale
TypeScript
Stelle
36.9k
Fork
2.5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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)

Linux, ARMv7

### Installation

GitHub releases or script from README

### Setup

Other (please mention in the description)

### AdGuard Home version

v0.108.0-b.77

### Action

1. Disable the DHCP server on the router and configure the built-in one to use the local TLD `.lan`.
1. Add a static lease with the hostname `example`, so that it can be resolved through `example.lan`.
1. Add a custom filtering rule:
```adblock
||example.lan^$dnsrewrite=example.lan
```
1. Query a subdomain of the aforementioned client's hostname:
```sh
dig @ service.example.lan
```

### Expected result

At the very least the proper response with the specified CNAME record should have been returned. Ideally, the actual IP address of the DHCP client would be resolved.

### Actual result

```none
;; Question section mismatch: got example.lan/A/IN
```

### Additional information and/or screenshots

The same scheme works works with the real-world domain names. So adding the rule:
```adblock
||example.org^$dnsrewrite=example.org
```
makes the following request:
```sh
dig @ subdomain.example.org
```
resolve into a proper response with CNAME and the corresponding A records:
```none
;; QUESTION SECTION:
;subdomain.example.org. IN A

;; ANSWER SECTION:
subdomain.example.org. 10 IN CNAME example.org.
example.org. 102 IN A 23.215.0.133
example.org. 102 IN A 23.220.75.235
example.org. 102 IN A 23.220.75.238
example.org. 102 IN A 23.215.0.132
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.