Skip to content

Instantly share code, notes, and snippets.

@chgeuer
Created January 30, 2015 09:43
Show Gist options
  • Save chgeuer/57b069859c0b4143b4e2 to your computer and use it in GitHub Desktop.
Save chgeuer/57b069859c0b4143b4e2 to your computer and use it in GitHub Desktop.
Retrieve DNS Records
// <package id="Heijden.Dns" version="1.0.0" targetFramework="net45" />
var aRecord = new Heijden.DNS.Resolver().Query("somedomain.de", Heijden.DNS.QType.A);
foreach (var x in aRecord.Answers)
Console.WriteLine("Answer: {0} is an {1} record for {2} (TTL {3})",
x.NAME, x.Type, x.RECORD, TimeSpan.FromSeconds( x.TTL));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment