[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Adding DNS A Record on DNS Server

Posted on 2006-07-19
8
Medium Priority
?
1,013 Views
Last Modified: 2010-08-05
Hi ,
Is it possible to interface with the DNS Server to create and delete A records? I am trying to create a utility that will create (A) Host records automatically using C#. I have read that it is possible with WMI.  Any information, help or examples would be greatly appreciated.
Regards
Srinivas
0
Comment
Question by:srinvask
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
8 Comments
 
LVL 13

Expert Comment

by:devsolns
ID: 17141325
DNS's underlying storage mechanism is simply text files *.dns.  you can read them/edit them in notepad.  so in other words adding/editing/removing dns records is simply a matter of alterning these text files.  it maybe get a little more complicated if you have active directory intergrated dns.  If so the only thing different is there will be a serial number at the top that AD uses to ensure proper synchronization.  You'll need to increment this number by 1.  you'll find these files in the C:\[windows]\system32\dns\ folder.


-gp
0
 
LVL 13

Expert Comment

by:devsolns
ID: 17141334
To bring c# into this, System.IO.* should provide everything you need to do this.
0
 
LVL 8

Expert Comment

by:navalarya1982
ID: 17142259
are u interacting with DNS servers located remotely or is the application running in same machine as dns server ?
0
 

Author Comment

by:srinvask
ID: 17147690
No the application is running on a different machine.
0
 
LVL 13

Accepted Solution

by:
devsolns earned 2000 total points
ID: 17148542
Here is a link to microsoft to download the WMI DNS resource kit.

ftp://ftp.microsoft.com/reskit/win2000/dnsprov.zip



DNS WMI Provider creates and populates WMI classes, which reference information contained in DNS zones and their resource records. The provider can be used to manipulate DNS servers, zones, and individual records. All necessary files are downloadable from the Microsoft FTP Site at ftp://ftp.microsoft.com/reskit/win2000/dnsprov.zip.

To install the provider, after extracting the content of the zip file, copy the dnsschema.mof to %systemroot%\system32\wbem\mof folder. The file should get automatically compiled and moved to the Good subfolder. Then copy the dnsprov.dll to the %systemroot%\system32\wbem folder and register it with the operating system by running: regsvr32 dnsprov.dll. You should get the confirmation of the successfull registration.

You can review the classes created by the MOF file compilation by either checking the documentation provided with the source files or by running any of the utilities included with WMI SDK (such as CIM WMI Studio) or WbemTest.exe, available on any computer with WMI installed (any Windows 2000 computer). DNS Provider populates a separate namespace in the WMI hierarchy - root\MicrosoftDNS. The namespace contains about 30 DNS related classes.

Along with the provider dll and MOF file, the downloaded zip file contains several VBScript examples, which allow you to accomplish most of the DNS related management tasks. For example, dnsserver.vbs can be used to:

- stop DNS server
cscript //nologo dnsserver.vbs stop

- start DNS server
cscript //nologo dnsserver.vbs start <

- restart DNS server
cscript //nologo dnsserver.vbs restart

- list DNS server configuration
cscript //nologo dnsserver.vbs LIST

- list zones on the DNS server
cscript //nologo dnsserver.vbs zone

- modify the configuration of the DNS server
cscript //nologo dnsserver.vbs modify

With dnszones.vbs, you can create, modify, add, delete, pause, update, resume, reload, and refresh DNS zones.
dnsrecord.vbs allows you to add, delete, modify, and list resource records
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question