looterz / grimd

:zap: fast dns proxy that can run anywhere, built to black-hole internet advertisements and malware servers
MIT License
1.38k stars 108 forks source link

Only single custom record returned per host #114

Closed Cottand closed 10 months ago

Cottand commented 1 year ago

With the following custom records config:

customdnsrecords = [
    "test1.     3600      IN  A   10.8.0.1  ",
    "test1.     3600      IN  A   10.8.0.2  ",
]

I get the following dig output:

❯ dig test1

; <<>> DiG 9.10.6 <<>> test1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48412
;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;test1.             IN  A

;; ANSWER SECTION:
test1.          3600    IN  A   10.8.0.2

;; Query time: 107 msec
;; SERVER: 10.8.0.1#53(10.8.0.1)
;; WHEN: Wed Aug 09 23:56:53 WEST 2023
;; MSG SIZE  rcvd: 44

I would expect the answer section to have all of the A records I provided (so, both 10.8.0.1 and 10.8.0.2). More critically, this also happens when using several DNS records of different types. For the following config:

customdnsrecords = [
    "test1.     3600      IN  A              10.8.0.1  ",
    "test1.     3600      IN  SRV 0 0  443   test1.    ",
]

I get:

❯ dig test1

; <<>> DiG 9.10.6 <<>> test1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51739
;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;test1.             IN  A

;; ANSWER SECTION:
test1.          3600    IN  SRV 0 0 443 test1.

;; Query time: 95 msec
;; SERVER: 10.8.0.1#53(10.8.0.1)
;; WHEN: Thu Aug 10 00:01:53 WEST 2023
;; MSG SIZE  rcvd: 53

With no A record in the answer section

Cottand commented 10 months ago

Until https://github.com/looterz/grimd/pull/115 (the fix) gets merged, this is fixed in https://github.com/Cottand/grimd v1.2.0 and bove