Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upEnv variable to specify nameserver for local testing #839
Comments
This comment has been minimized.
This comment has been minimized.
|
We should get away from hard-depending on the presence of In any case, going back to the stdlib would conflict with your goal here (but would be nice for other reasons), since the stdlib's DNS resolver can't be configured to not use So I think this is a valid use case, but I am not sure how it can be implemented nicely and consistently without causing a lot of extra code noise. @miekg - maybe any brilliant ideas? :) |
This comment has been minimized.
This comment has been minimized.
|
I feel unsure about adding code to prometheus for such special use cases. The interface on linux is to lookup DNS servers via @mwitkow-io What about running your prometheus in a docker container locally, which allows you to specify DNS servers via the |
This comment has been minimized.
This comment has been minimized.
miekg
commented
Jun 25, 2015
|
[ Quoting notifications@github.com in "Re: [prometheus] Env variable to sp..." ]
... and also note that names like "nodes..com" as wildcard addresses won't be Looking at the CL linked from the prometheus issue, it seems they still don't
..Maybe... 2 things.
This will give the desired effect with no code changes to prometheus and a small Thoughts? /Miek Miek Gieben |
This comment has been minimized.
This comment has been minimized.
|
@miekg That's great info, I wasn't aware of the wildcard issues that SkyDNS users would be having with the standard library. I don't think we want to do 2), but out of curiosity, how would you do it? Use a custom dialer for the
I tend to agree with @grobie on the other points. |
This comment has been minimized.
This comment has been minimized.
miekg
commented
Jun 25, 2015
|
Re 2) isn't this the default for Go?
Any lookup SkyDNS would do via net.LookupXXX would be handled by glibc, AFAICT an LD_PRELOAD trick would still work here. So no code changes needed. I also like the idea of using docker for local tests though. |
This comment has been minimized.
This comment has been minimized.
|
docker is the best approach for your tests |
This comment has been minimized.
This comment has been minimized.
|
@miekg Yes, when you import
|
This comment has been minimized.
This comment has been minimized.
miekg
commented
Jun 26, 2015
|
[ Quoting notifications@github.com in "Re: [prometheus] Env variable to sp..." ]
What a f*cking mess this is... Because if you look at net.LookupCNAME it has:
Which uses glibc immediately. My my, so what you hit depends on the actual RR |
This comment has been minimized.
This comment has been minimized.
|
Yep - so due to all that I wouldn't want to add an env variable for this into Prometheus itself and would advocate for going the Docker route instead. Or hey, if Docker is too heavy-weight, how about a simple Closing this for now. |
juliusv
closed this
Jun 30, 2015
This comment has been minimized.
This comment has been minimized.
|
Yea, this seems pretty heavyweight after all. Docker seems like a good temporary solution. |
simonpasquier
pushed a commit
to simonpasquier/prometheus
that referenced
this issue
Oct 12, 2017
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 24, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
mwitkow commentedJun 24, 2015
Use case:
I want to develop Prometheus alerts, configs and rules locally. However, my resolv.conf points to our corp DNS, which is different from the prod DNS that Prometheus uses to
resolv.conf. We do have a corp2prod bridge, so I can temporarily override/etc/resolv.confwith the bridge to prod DNS, but that is a) cumbersome b) affects other processesCan we have an ENV variable
PROMETHEUS_NAMESERVERSthat will be used instead of /etc/resolv.conf for local dev?@miekg for context.