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

Add check to resolve host with specified nameserver #68

Open
soellman opened this issue Jul 27, 2015 · 6 comments
Open

Add check to resolve host with specified nameserver #68

soellman opened this issue Jul 27, 2015 · 6 comments
Labels

Comments

@soellman
Copy link

The use case here is to check and see if the nameserver is resolving what we'd expect instead of whether a name can be resolved on the host.

@langston-barrett
Copy link
Contributor

This looks easy to do. I'm planning to implement this using a dns library, rather than a call to nslookup or some such. An example application that does exactly what this check needs is available here.

@soellman
Copy link
Author

Awesome. I'd be happy do this to too if you like.

@langston-barrett
Copy link
Contributor

@soellman Already working on it :) I could use a little help on the template functions, as I'm less sure where to start with those. I'll push my branch on this once I have an intial setup, and maybe you could do the same with templating functions, if you have the time?

@soellman
Copy link
Author

Sure, no problem. I'll work on it tomorrow.
-o

@langston-barrett
Copy link
Contributor

@soellman This check is now in the branch check/dns-arecord. It currently only supports A records. I'll let you give it a whirl before merging, in case it doesn't fit your use case or doesn't work as you might expect.

"aRecord"

  • Description: Test whether or not the DNS server resolves the given name to the expected IP address
  • Inputs:
    • Name, e.g. "mozilla.org"
    • Expected IP address, e.g. "192.168.0.1"
    • DNS server to check with, e.g. "8.8.8.8"

@soellman
Copy link
Author

I'd vote for splitting this up a bit. Maybe instead of aRecord, you could have:

resolveDNS which takes name, nameserver (optional?), type (default A?) - like the "host" check but with args
resolveDNSMatches which takes name, value, nameserver (optional?), type (default A?)

For my case, I don't actually want to know what the result was, just that I got one. This might be used for testing a forwarding dns server with a well known name (like google.com).

And to make it simple for now, most people will only use the A record anyways so support for more record types could get filled out if/when people request them.

I tested the branch and the simple matching case works great :)
-o

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

No branches or pull requests

2 participants