Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow CNAME support, not just "A" record #38

Open
dapeleg-dn opened this issue Jan 31, 2023 · 5 comments
Open

Allow CNAME support, not just "A" record #38

dapeleg-dn opened this issue Jan 31, 2023 · 5 comments

Comments

@dapeleg-dn
Copy link

Use case: I have an internal machine in my private network with DNS: myvm.mycompany.com.

I need it to support wildcard subdomains, for example: db.admin.myvm.mycompany.com. This is useful when I use a reverse proxy or Kubernetes ingress controller, mapping host name to a service. From the host name it knows where to route the traffic. This is an elegant alternative to opening additional ports or using URL-prefix and URL-rewrite.

As long as the internal IP doesn't change, I can easily define service.10.10.1.1.nip.io and db.admin.10.10.1.1.nip.io. They both return the same IP, but in my reverse proxy or ingress controller, I can map them to different services, by the supplied host name HTTP header. (The usual web "virtual host" approach.)

The question is what to do if IP changes frequently, and it's beyond my control.

My suggested solution is to use part of nip.io DNS service as a service that only returns CNAME alias instead of "A" record with a static IP.

For example, I may use myvm.mycompany.com.cname.nip.io to get CNAME response pointing to myvm.mycompany.com. And db.admin-myvm.mycompany.com.cname.nip.io will also give CNAME response of myvm.mycompany.com. So if my company's IT staff changes the IP of the internal machine myvm, all URLs will stay valid, since they are just a CNAME reference to the real machine name.

@normanr
Copy link

normanr commented Feb 25, 2023

Why not just use the original name? i.e. instead of myvm.example.com.cname.nip.io, why not just use myvm.example.com?

Ahh, you want it for handling wildcard names. You can add these in your local dns too, i.e. you can configure *.myvm.example.com to be a CNAME for myvm.example.com.

@dapeleg-dn
Copy link
Author

@normanr, the whole idea is that I have no control over my company's DNS servers and that I don't want to make just local changes to /etc/hosts file on my machine but to be able to share a URL between all team members easily.

I am sure there are more use cases; this is just one that I found helpful for me.

@normanr
Copy link

normanr commented Mar 2, 2023

You should chat to your network administrator about adding wildcard names for your machine. I'm sure they'd prefer to keep DNS requests with private company machine names internal to their network instead of sending them to a 3rd party service somewhere on the internet.

@dapeleg-dn
Copy link
Author

I am asking from a technical perspective. Believe me that if I wanted to talk to my administrator I would not have to come here. Finding people-related solutions is not the purpose of GitHub. Since technically it's possible I am asking here to implement that. I don't need a GitHub issue to tell me "that's not possible". We're here to make things possible and to develop new innovative technical solutions, not to be stuck in "this-is-not-possible land".

@jc01rho
Copy link

jc01rho commented Apr 14, 2023

exactly facing same issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants