Skip to content

🐛 Bug Report: "Internal server error" when using DNS Rewrite on Local DNS #28

@ryuupendragon

Description

@ryuupendragon

👟 Reproduction steps

I'm using Pocket ID as my OIDC Provider. When I'm using custom DNS rewrite on Adguard Home for pocket id (id.mydomain.com) site on my local network getting below error. After disabling the rewrite for pocket id (id.mydomain.com) it's started working normally.

I have Unraid as my primary home server and RPI4 as secondary server. On longer power outage, I'll turnoff Unraid to save power on the Inverter UPS. So I'm running Pocket ID on RPI4. I have caddy running on both machines, Unraid one for external services and RPI4 for internal services. I'm using DNS rewrite on Adguard Home so even if Unraid is offline, pocket id will be still working.

When accessing id.mydoamin.com from outside, First it'll go to caddy on unraid and pocket id container on RPI4. When accessing it from inside, DNS rewrite will make it to go to caddy on RPI4 then pocket id container on RPI4.

👍 Expected behavior

Other Services are working without any issues.

👎 Actual Behavior

{"statusCode":500,"message":"Internal server error"}

📜 Logs

[Nest] 49  - 12/27/2025, 8:56:12 PM   ERROR [ExceptionsHandler] TypeError: fetch failed
    at node:internal/deps/undici/undici:14900:13
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async OidcProvider.getToken (/opt/app/backend/dist/src/oauth/provider/genericOidc.provider.js:60:21)
    at async OAuthController.callback (/opt/app/backend/dist/src/oauth/oauth.controller.js:49:28) {
  [cause]: Error: getaddrinfo ENOTFOUND id.mydomain.com
      at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:122:26) {
    errno: -3008,
    code: 'ENOTFOUND',
    syscall: 'getaddrinfo',
    hostname: 'id.mydomain.com'
  }
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions