mr-karan / doggo

:dog: Command-line DNS Client for Humans. Written in Golang
https://doggo.mrkaran.dev/
GNU General Public License v3.0
2.83k stars 100 forks source link

Docker doggo-web doh query #132

Closed gkl1368 closed 2 months ago

gkl1368 commented 2 months ago

when query dns use doh like https in docker doggo-web, it shows error: tls: failed to verify certificate: x509: certificate signed by unknown authority". but it works ok when I run doggo-web.bin in the host.

mr-karan commented 2 months ago

Can you tell me steps to repro?

docker run --rm ghcr.io/mr-karan/doggo:latest mrkaran.dev  @https://cloudflare-dns.com/dns-query

NAME            TYPE    CLASS   TTL     ADDRESS         NAMESERVER
mrkaran.dev.    A       IN      300s    104.21.7.168    https://cloudflare-dns.com/dns-query

Both CLI and web work normally:

image
gkl1368 commented 2 months ago

I use this docker: ghcr.io/mr-karan/doggo-web:latest time=2024-07-02T16:47:22.735Z level=ERROR msg="error in lookup" error="Post \"https://cloudflare-dns.com/dns-query\": tls: failed to verify certificate: x509: certificate signed by unknown authority" And I try run doggo-web.bin in the same host, it works

mr-karan commented 2 months ago
docker run --rm ghcr.io/mr-karan/doggo:latest  mrkaran.dev @https://cloudflare-dns.com/dns-query --short

104.21.7.168
172.67.187.239

This did work, however I noticed the container doesn't have ca-certificates and it might likely be because of that. Just wondering why I am unable to reproduce it. I'll push ca-certificates in the next release and you can try with that.

gkl1368 commented 2 months ago

I have add this line in web.Dockerfile RUN apt-get update && apt install -y \ ca-certificates && update-ca-certificates \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* and rebuild the image. Now it works fine.

mr-karan commented 2 months ago

Thanks. I'll be pushing a fix for this in the next version