[GH-ISSUE #2368] Does CNAME destinations work? #1676

Closed
opened 2026-02-26 07:31:59 +03:00 by kerem · 5 comments
Owner

Originally created by @pszypowicz on GitHub (Nov 4, 2022).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2368

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug

I have 2 entries in my dns server:
sub1.domain.com -> CNAME sub2.domain.com
sub2.domain.com -> A record 192.168.0.2

I can get IP's of both from the shell of NPM container:

$ getent hosts sub2.domain.com
192.168.0.2 sub2.domain.com
$ getent hosts sub1.domain.com
192.168.0.2 sub2.domain.com sub1.domain.com

I'm configuring Proxy Host.

When I will configure destination to point to sub2.domain.com, everything works.

But when I'm using sub1.domain.com I see following error in the error_log:

sub1.domain.com could not be resolved (3: Host not found)

Nginx Proxy Manager Version

v2.9.18

To Reproduce
Steps to reproduce the behavior:

  1. Configure the destination
  2. Visit site in broswer, get 502
  3. Check the error_log and see Host not found

Expected behavior

Site should work

Operating System

Synology docker

  • NPM container with macvlan
  • A record points to synology macvlan shim interface

Additional context

DNS is handled with Adguard DNS rewrites

Originally created by @pszypowicz on GitHub (Nov 4, 2022). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2368 <!-- Are you in the right place? - If you are looking for support on how to get your upstream server forwarding, please consider asking the community on Reddit. - If you are writing code changes to contribute and need to ask about the internals of the software, Gitter is the best place to ask. - If you think you found a bug with NPM (not Nginx, or your upstream server or MySql) then you are in the *right place.* --> **Checklist** - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - Yes - Are you sure you're not using someone else's docker image? - Yes - Have you searched for similar issues (both open and closed)? - Yes **Describe the bug** <!-- A clear and concise description of what the bug is. --> I have 2 entries in my dns server: sub1.domain.com -> CNAME sub2.domain.com sub2.domain.com -> A record 192.168.0.2 I can get IP's of both from the shell of NPM container: ```sh $ getent hosts sub2.domain.com 192.168.0.2 sub2.domain.com $ getent hosts sub1.domain.com 192.168.0.2 sub2.domain.com sub1.domain.com ``` I'm configuring Proxy Host. When I will configure destination to point to sub2.domain.com, everything works. But when I'm using sub1.domain.com I see following error in the error_log: ``` sub1.domain.com could not be resolved (3: Host not found) ``` **Nginx Proxy Manager Version** <!-- What version of Nginx Proxy Manager is reported on the login page? --> v2.9.18 **To Reproduce** Steps to reproduce the behavior: 1. Configure the destination 2. Visit site in broswer, get 502 3. Check the error_log and see `Host not found` **Expected behavior** <!-- A clear and concise description of what you expected to happen. --> Site should work **Operating System** <!-- Please specify if using a Rpi, Mac, orchestration tool or any other setups that might affect the reproduction of this error. --> Synology docker - NPM container with macvlan - A record points to synology macvlan shim interface **Additional context** <!-- Add any other context about the problem here, docker version, browser version, logs if applicable to the problem. Too much info is better than too little. --> DNS is handled with Adguard `DNS rewrites`
kerem 2026-02-26 07:31:59 +03:00
  • closed this issue
  • added the
    stale
    bug
    labels
Author
Owner

@skirven4 commented on GitHub (Nov 6, 2022):

I have a CNAME set up, and it works fine. Do you have a valid entry in NPM that would resolve to your sub1.domain.com and would be accessible from the same location where you NPM is residing?

<!-- gh-comment-id:1304809468 --> @skirven4 commented on GitHub (Nov 6, 2022): I have a CNAME set up, and it works fine. Do you have a valid entry in NPM that would resolve to your sub1.domain.com and would be accessible from the same location where you NPM is residing?
Author
Owner

@the1ts commented on GitHub (Nov 6, 2022):

What DNS server is in /data/nginx/resolvers.conf I think this is made at first start and if you have changed DNS servers since perhaps that needs updating. i.e. the NPM container and the Nginx may use different DNS servers for the lookup giving you the differing results you are seeing.
The container (/etc/resolv.conf) probably uses 127.0.0.11 so points to the docker service which combines both docker hosted container names and forwards to the host to lookup requests external to docker.

<!-- gh-comment-id:1304825174 --> @the1ts commented on GitHub (Nov 6, 2022): What DNS server is in /data/nginx/resolvers.conf I think this is made at first start and if you have changed DNS servers since perhaps that needs updating. i.e. the NPM container and the Nginx may use different DNS servers for the lookup giving you the differing results you are seeing. The container (/etc/resolv.conf) probably uses 127.0.0.11 so points to the docker service which combines both docker hosted container names and forwards to the host to lookup requests external to docker.
Author
Owner

@pszypowicz commented on GitHub (Mar 4, 2023):

I found some time to reproduce the problem again and investigate it deeper.

I do not have /data/nginx/resolvers.con file, but I found that file in /etc/nginx/conf.d/include and it looks like this

[root@docker-7e906569418d:/etc/nginx/conf.d/include]# cat resolvers.conf
resolver 127.0.0.11  valid=10s;
[root@docker-7e906569418d:/etc/nginx/conf.d/include]# cat /etc/resolv.conf
nameserver 127.0.0.11
options ndots:0

So it looks like they both use the same dns server?

<!-- gh-comment-id:1454687949 --> @pszypowicz commented on GitHub (Mar 4, 2023): I found some time to reproduce the problem again and investigate it deeper. I do not have `/data/nginx/resolvers.con` file, but I found that file in `/etc/nginx/conf.d/include` and it looks like this ``` [root@docker-7e906569418d:/etc/nginx/conf.d/include]# cat resolvers.conf resolver 127.0.0.11 valid=10s; [root@docker-7e906569418d:/etc/nginx/conf.d/include]# cat /etc/resolv.conf nameserver 127.0.0.11 options ndots:0 ``` So it looks like they both use the same dns server?
Author
Owner

@github-actions[bot] commented on GitHub (Feb 6, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:1928635488 --> @github-actions[bot] commented on GitHub (Feb 6, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@github-actions[bot] commented on GitHub (Mar 22, 2025):

Issue was closed due to inactivity.

<!-- gh-comment-id:2744893341 --> @github-actions[bot] commented on GitHub (Mar 22, 2025): Issue was closed due to inactivity.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#1676
No description provided.