• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 932
  • Last Modified:

DNS in vb.net

Hi All,

I'm trying to write a script that will enable me to read all subdomains records from a
DNS server.
e.d. microsoft.com should report back:

Who can help me?

Right now i use:
            Dim cn As String = "microsoft.com"
            Dim ip As System.Net.IPHostEntry = System.Net.Dns.Resolve(cn)
            Dim addresses As System.Net.IPAddress() = ip.AddressList
            Dim ipaddress As String = addresses(0).ToString()
  • 3
  • 2
1 Solution
You can use DIG(Domain Information Groper)

vraagAuthor Commented:
Dig is a linux command right?
I'll keep looking for a vb.net solution
Chris DentPowerShell DeveloperCommented:
You mean to target MS DNS servers from a management stand-point?

You will not get a list of delegations using the DNS protocol short of Zone Transfer.

A Cyber Security RX to Protect Your Organization

Join us on December 13th for a webinar to learn how medical providers can defend against malware with a cyber security "Rx" that supports a healthy technology adoption plan for every healthcare organization.

vraagAuthor Commented:
Basically i don't care which DNS server some one has.
I need to manage domains but they are not all hosted in 1 place so all dfferent systems.
Therefore i like to be able, as linux has the DIG command, do retrieve alle dns records from these domains with a programm that will handle all DNS servers
Chris DentPowerShell DeveloperCommented:
Yeah, but Dig cannot retrieve all DNS records for a domain either, except using AXFR (Zone Transfer), which must be explicitly granted on the server. This is by design.

So, I can execute a query in Dig, or NsLookup, or I can write my own resolver, and I can request specific things (such as the NS records for domain.com). But I cannot ask for a list of delegations (child / sub-domains) for any given name space, there's no way to format a query to do that (except AXFR mentioned above).

If you want it, and you cannot transfer the zone, you have to have administrative access to the DNS server, and you have to write a management interface that will talk to the DNS server (outside of the DNS protocol). If you end up talking about admin interfaces you must care about the system type, generic is out.

If all you really care about is the resolver, there are a number of .NET examples kicking around including this one:


I have my own open-source resolver, it too is written in C# .NET I'm afraid.

vraagAuthor Commented:
It's not what i hoped, but realistic is the word.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now