Skip to main content

Posts

Showing posts with the label DNS

Windows Server 2008 R2 DNS issues

This week we stumbled upon some weirdness in our new 2008 R2 DNS servers. A couple of URLs, for example www.smhi.se and www.stockholm.se could not be resolved from a 2008 R2 server. The existing 2003 servers with the same configuration worked perfectly. After thorough troubleshooting we found out that there is a new default setting in Windows Server 2008 R2 regarding the  EDNS-protocol  that caused the issues. Not all of the DNS servers around the internet are able to handle  EDNS , but in 2008 R2 this protocol is enabled by default. Normally you would think there is a fallback mechanism to standard DNS protocol if an EDNS request fails, but Windows Server does not have that. The solution was simply to disable EDNS by using the command: dnscmd /config /EnableEDNSProbes 0 Scott Forsyth has written more about this issue and how he found the solution: http://weblogs.asp.net/owscott/archive/2009/09/15/windows-server-2008-r2-dns-issues.aspx

Get DNS-information using WMI

With the purpose of automation DNS documentation I needed to get information programatically from the DNS servers. The answer to this, and many other similar tasks is spelled  WMI . That is short for  Windows Management Instrumentation , which is an infrastructure for getting information from Windows using a specific query language. Here is a method to get the host names and IP addresses for each A-record on the specified domain. public string Server = "192.168.0.1"; public string Domain = "domain.local"; public string Username = "DOMAIN\User"; public string Password = "Pa$$w0rd"; public Dictionary<string, string> GetHosts() { Dictionary<string, string> hosts = new Dictionary<string, string>(); ManagementScope scope = new ManagementScope(String.Format(@"\\{0}\Root\MicrosoftDNS", Server)); scope.Options.Impersonation = ImpersonationLevel.Impersonate; scope.Options.Username = Username; scope.Opti...