[GH-ISSUE #58] [issue] Support a mask in hostnames #22

Closed
opened 2026-02-26 04:33:48 +03:00 by kerem · 4 comments
Owner

Originally created by @spravo on GitHub (Jan 18, 2018).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/58

Originally assigned to: @mageddo on GitHub.

Thank for your awesome project. Will your project support a mask in hostnames, like test.com,*.test.com.

Thank

Originally created by @spravo on GitHub (Jan 18, 2018). Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/58 Originally assigned to: @mageddo on GitHub. Thank for your awesome project. Will your project support a mask in hostnames, like `test.com,*.test.com`. Thank
kerem 2026-02-26 04:33:48 +03:00
  • closed this issue
  • added the
    feature
    label
Author
Owner

@mageddo commented on GitHub (Jan 18, 2018):

Thank you for your feedback.

Will your project support a mask in hostnames, like test.com,*.test.com

Did you mean for example, if I register a container with *.test.com hostname then all it subdomains resolve to that container? A test case

docker run --hostname *.test.com nginx

Then when I try to solve

nslookup mageddo.test.com

It points to NGINX container? If yes please describe a real world use case for that.

<!-- gh-comment-id:358805226 --> @mageddo commented on GitHub (Jan 18, 2018): Thank you for your feedback. > Will your project support a mask in hostnames, like test.com,*.test.com Did you mean for example, if I register a container with `*.test.com` hostname then all it subdomains resolve to that container? A test case ``` docker run --hostname *.test.com nginx ``` Then when I try to solve ``` nslookup mageddo.test.com ``` It points to NGINX container? If yes please describe a real world use case for that.
Author
Owner

@spravo commented on GitHub (Jan 21, 2018):

Use case:

nginx.conf

server {
    server_name ~^(?<subdomain>.*)\.test.dev;
    set $proxyhost backend;

    location = / {
        proxy_pass http://$proxyhost?subdomain=$subdomain;
    }
}

docker-compose.yml

dns-proxy-server:
   image: defreitas/dns-proxy-server
   name: dns-proxy-server
   hostname: dns.mageddo
   ports:
       - 5380:5380
  volumes:
       - /var/run/docker.sock:/var/run/docker.sock
       - /etc/resolv.conf:/etc/resolv.conf

nginx:
    image: nginx
    ports:
      - 80:80
      - 443:443
   environment:
       # Here I list all the hosts for the development mode
       - HOSTNAMES=test.dev,subdomain1.test.dev,subdomain2.test.dev
       # - HOSTNAMES=test.dev,*.test.dev
    volumes:
      - /host/path/nginx.conf:/etc/nginx/nginx.conf:ro
<!-- gh-comment-id:359255660 --> @spravo commented on GitHub (Jan 21, 2018): ## Use case: nginx.conf ```text server { server_name ~^(?<subdomain>.*)\.test.dev; set $proxyhost backend; location = / { proxy_pass http://$proxyhost?subdomain=$subdomain; } } ``` docker-compose.yml ```yml dns-proxy-server: image: defreitas/dns-proxy-server name: dns-proxy-server hostname: dns.mageddo ports: - 5380:5380 volumes: - /var/run/docker.sock:/var/run/docker.sock - /etc/resolv.conf:/etc/resolv.conf nginx: image: nginx ports: - 80:80 - 443:443 environment: # Here I list all the hosts for the development mode - HOSTNAMES=test.dev,subdomain1.test.dev,subdomain2.test.dev # - HOSTNAMES=test.dev,*.test.dev volumes: - /host/path/nginx.conf:/etc/nginx/nginx.conf:ro ```
Author
Owner

@mageddo commented on GitHub (Feb 7, 2018):

@spravo I developed this feature at version 2.3.3

I configured that a bit different, you just have to put . front the domain like .github.com and not *.github.com

Please check it solves your requeriments

<!-- gh-comment-id:363897681 --> @mageddo commented on GitHub (Feb 7, 2018): @spravo I developed this feature at version [2.3.3](https://github.com/mageddo/dns-proxy-server/releases/download/2.3.3/dns-proxy-server-2.3.3.tgz) I configured that a bit different, you just have to put `.` front the domain like `.github.com` and not `*.github.com` Please check it solves your requeriments
Author
Owner

@spravo commented on GitHub (Feb 8, 2018):

@mageddo, I checked.
You did awesome work, thank you

<!-- gh-comment-id:364248918 --> @spravo commented on GitHub (Feb 8, 2018): @mageddo, I checked. You did awesome work, thank you
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/dns-proxy-server-mageddo#22
No description provided.