?
Solved

Adding DNS A Record on DNS Server

Posted on 2006-07-19
8
Medium Priority
?
1,000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
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…
Suggested Courses
Course of the Month10 days, 21 hours left to enroll

770 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