473,407 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

DNS Server

Hi,
Is it possible to interface with the DNS Server to create and delete
records? I trying to create a utility that will create (A) Host records
automatically. Any information, help or examples would be greatly received.

Regards, Leigh
Jul 21 '05 #1
9 4639
Anybody, anything !?

Desperate, Leigh

"Leigh" <someone@ somewhere> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,
Is it possible to interface with the DNS Server to create and delete
records? I trying to create a utility that will create (A) Host records
automatically. Any information, help or examples would be greatly received.
Regards, Leigh

Jul 21 '05 #2
yes. One way is to use a tool like nsupdate.exe and start that in a
process and get the return codes. To do it with code, I would use WMI. Has
all the methods for createzone, add rrs, (etc.), and you can do it with with
the system.management classes. Get and use the WMITools on the ms site, and
the dnsprov.dll in the w2k resource kit or on the ftp site. The wmitools
really help figure out what methods are in each class and how to call them
and what they return, etc. If you just need to create A records, I could
send you an example in c# if you like.

--
William Stacey, DNS MVP

"Leigh" <someone@ somewhere> wrote in message
news:u8**************@TK2MSFTNGP11.phx.gbl...
Anybody, anything !?

Desperate, Leigh

"Leigh" <someone@ somewhere> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,
Is it possible to interface with the DNS Server to create and delete
records? I trying to create a utility that will create (A) Host records
automatically. Any information, help or examples would be greatly

received.

Regards, Leigh


Jul 21 '05 #3
William,
I would really appreciate it if you would send me an example. please send
to leigh DOT pointer AT subzero-solutions DOT net

Thank you, Leigh

"William Stacey" <st*****@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
yes. One way is to use a tool like nsupdate.exe and start that in a
process and get the return codes. To do it with code, I would use WMI. Has all the methods for createzone, add rrs, (etc.), and you can do it with with the system.management classes. Get and use the WMITools on the ms site, and the dnsprov.dll in the w2k resource kit or on the ftp site. The wmitools
really help figure out what methods are in each class and how to call them
and what they return, etc. If you just need to create A records, I could
send you an example in c# if you like.

--
William Stacey, DNS MVP

"Leigh" <someone@ somewhere> wrote in message
news:u8**************@TK2MSFTNGP11.phx.gbl...
Anybody, anything !?

Desperate, Leigh

"Leigh" <someone@ somewhere> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,
Is it possible to interface with the DNS Server to create and delete records? I trying to create a utility that will create (A) Host records automatically. Any information, help or examples would be greatly

received.

Regards, Leigh



Jul 21 '05 #4
Leigh,

It is considered bad Netiquette to request that answers be sent to your
personal email address.

Many newsgroup "posters" do not respond to these kinds of requests. Why
"hog" the answer all for yourself? Maybe some of us would like to see the
answer as well.
"Leigh" <someone@ somewhere> wrote in message
news:e8*************@TK2MSFTNGP11.phx.gbl...
William,
I would really appreciate it if you would send me an example. please send
to leigh DOT pointer AT subzero-solutions DOT net

Thank you, Leigh

"William Stacey" <st*****@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
yes. One way is to use a tool like nsupdate.exe and start that in a
process and get the return codes. To do it with code, I would use WMI.

Has
all the methods for createzone, add rrs, (etc.), and you can do it with

with
the system.management classes. Get and use the WMITools on the ms site,

and
the dnsprov.dll in the w2k resource kit or on the ftp site. The wmitools
really help figure out what methods are in each class and how to call them and what they return, etc. If you just need to create A records, I could send you an example in c# if you like.

--
William Stacey, DNS MVP

"Leigh" <someone@ somewhere> wrote in message
news:u8**************@TK2MSFTNGP11.phx.gbl...
Anybody, anything !?

Desperate, Leigh

"Leigh" <someone@ somewhere> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
> Hi,
> Is it possible to interface with the DNS Server to create and

delete > records? I trying to create a utility that will create (A) Host records > automatically. Any information, help or examples would be greatly
received.
>
> Regards, Leigh
>
>



Jul 21 '05 #5
If you run your DNS on w2k or w2k3 there are several options.

If your zone is AD based you can use the System.DirectoryServices Namespace
to query or update the DNS directly.

Another option is to use the DNS Api to manipulate the DNS. look at
http://msdn.microsoft.com/library/de...asp?frame=true

And the last option is to use a third party component, capable of doing
dynamic updates on any DNS.

"Leigh" <someone@ somewhere> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,
Is it possible to interface with the DNS Server to create and delete
records? I trying to create a utility that will create (A) Host records
automatically. Any information, help or examples would be greatly received.
Regards, Leigh

Jul 21 '05 #6
Sure:
public void CreateRR(string zoneName, string rrTextRep)
{
if ( zoneName == null )
throw new ArgumentNullException("zoneName", "zoneName is null.");
if ( rrTextRep == null )
throw new ArgumentNullException("rrTextRep", "rrTextRep is null.");

InvokeMethodOptions options = new InvokeMethodOptions();
options.Timeout = new TimeSpan(0,0,0,5);

ManagementClass rrClass = new ManagementClass(
ms,
new ManagementPath("MicrosoftDNS_ResourceRecord"),
null);

//Get an input parameters object for this method
ManagementBaseObject inParams =
rrClass.GetMethodParameters("CreateInstanceFromTex tRepresentation");

//Fill in input parameter values
//inParams["DnsServerName"] = null; //Don't need.
inParams["ContainerName"] = zoneName;
inParams["TextRepresentation"] = rrTextRep;

//Execute the method
try
{
ManagementBaseObject outObject = rrClass.InvokeMethod
("CreateInstanceFromTextRepresentation", inParams, null);
PropertyDataCollection outProperties = outObject.Properties;
foreach (PropertyData outProperty in outProperties)
{
Console.WriteLine("Property = " + outProperty.Name);
}
}
catch
{
throw new ApplicationException("CreateInstanceFromTextRepres entation
method failed.");
}
} // End CreateInstanceFromTextRepresentation Method.

--
William Stacey, DNS MVP

"Leigh" <someone@ somewhere> wrote in message
news:e8*************@TK2MSFTNGP11.phx.gbl...
William,
I would really appreciate it if you would send me an example. please send
to leigh DOT pointer AT subzero-solutions DOT net

Thank you, Leigh

....
Jul 21 '05 #7
Scott I understand but
If you just need to create A records, I could send you an example in c# if you like.
I assumed William was going to send an example project or class file.

Leigh

"Scott M." <s-***@badspamsnet.net> wrote in message
news:O9**************@tk2msftngp13.phx.gbl...
Leigh,

It is considered bad Netiquette to request that answers be sent to your
personal email address.

Many newsgroup "posters" do not respond to these kinds of requests. Why
"hog" the answer all for yourself? Maybe some of us would like to see the
answer as well.
"Leigh" <someone@ somewhere> wrote in message
news:e8*************@TK2MSFTNGP11.phx.gbl...
William,
I would really appreciate it if you would send me an example. please send to leigh DOT pointer AT subzero-solutions DOT net

Thank you, Leigh

"William Stacey" <st*****@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
yes. One way is to use a tool like nsupdate.exe and start that in a
process and get the return codes. To do it with code, I would use
WMI. Has
all the methods for createzone, add rrs, (etc.), and you can do it
with with
the system.management classes. Get and use the WMITools on the ms
site, and
the dnsprov.dll in the w2k resource kit or on the ftp site. The

wmitools really help figure out what methods are in each class and how to call them and what they return, etc. If you just need to create A records, I could send you an example in c# if you like.

--
William Stacey, DNS MVP

"Leigh" <someone@ somewhere> wrote in message
news:u8**************@TK2MSFTNGP11.phx.gbl...
> Anybody, anything !?
>
> Desperate, Leigh
>
> "Leigh" <someone@ somewhere> wrote in message
> news:%2****************@TK2MSFTNGP11.phx.gbl...
> > Hi,
> > Is it possible to interface with the DNS Server to create and

delete
> > records? I trying to create a utility that will create (A) Host

records
> > automatically. Any information, help or examples would be greatly
> received.
> >
> > Regards, Leigh
> >
> >
>
>



Jul 21 '05 #8
Cool, thanks

"William Stacey" <st*****@mvps.org> wrote in message
news:eD**************@TK2MSFTNGP09.phx.gbl...
Sure:
public void CreateRR(string zoneName, string rrTextRep)
{
if ( zoneName == null )
throw new ArgumentNullException("zoneName", "zoneName is null.");
if ( rrTextRep == null )
throw new ArgumentNullException("rrTextRep", "rrTextRep is null.");

InvokeMethodOptions options = new InvokeMethodOptions();
options.Timeout = new TimeSpan(0,0,0,5);

ManagementClass rrClass = new ManagementClass(
ms,
new ManagementPath("MicrosoftDNS_ResourceRecord"),
null);

//Get an input parameters object for this method
ManagementBaseObject inParams =
rrClass.GetMethodParameters("CreateInstanceFromTex tRepresentation");

//Fill in input parameter values
//inParams["DnsServerName"] = null; //Don't need.
inParams["ContainerName"] = zoneName;
inParams["TextRepresentation"] = rrTextRep;

//Execute the method
try
{
ManagementBaseObject outObject = rrClass.InvokeMethod
("CreateInstanceFromTextRepresentation", inParams, null);
PropertyDataCollection outProperties = outObject.Properties;
foreach (PropertyData outProperty in outProperties)
{
Console.WriteLine("Property = " + outProperty.Name);
}
}
catch
{
throw new ApplicationException("CreateInstanceFromTextRepres entation
method failed.");
}
} // End CreateInstanceFromTextRepresentation Method.

--
William Stacey, DNS MVP

"Leigh" <someone@ somewhere> wrote in message
news:e8*************@TK2MSFTNGP11.phx.gbl...
William,
I would really appreciate it if you would send me an example. please send to leigh DOT pointer AT subzero-solutions DOT net

Thank you, Leigh

...

Jul 21 '05 #9
Thanks Rolf, very useful

"Rolf Enidsson" <ro***********@msecf.com> wrote in message
news:Ox**************@tk2msftngp13.phx.gbl...
If you run your DNS on w2k or w2k3 there are several options.

If your zone is AD based you can use the System.DirectoryServices Namespace to query or update the DNS directly.

Another option is to use the DNS Api to manipulate the DNS. look at
http://msdn.microsoft.com/library/de...asp?frame=true
And the last option is to use a third party component, capable of doing
dynamic updates on any DNS.

"Leigh" <someone@ somewhere> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,
Is it possible to interface with the DNS Server to create and delete
records? I trying to create a utility that will create (A) Host records
automatically. Any information, help or examples would be greatly

received.

Regards, Leigh


Jul 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Phil | last post by:
I am using a Pascal like language (Wealth-Lab) on W2K and call this server: class HelloWorld: _reg_clsid_ = "{4E797C6A-5969-402F-8101-9C95453CF8F6}" _reg_desc_ = "Python Test COM Server"...
6
by: Nathan Sokalski | last post by:
I want to set up SQL Server on Windows XP Pro so that I can use the database capabilities of ASP and IIS. I am probably using some incorrect settings, but I am not sure what they are. Here is what...
9
by: Grim Reaper | last post by:
My work let me put SQL Server 7.0 Enterprise Edition on my laptop. I have never setup a server from the beginning, so I am a little new at creating server groups. Alright, I am trying to create...
0
by: Chris Halcrow | last post by:
Hi I've spent ALL DAY trying to re-install SQL Server 2000 on Windows XP. I continually get the error 'cannot configure server' just at the end of the installation. I've tried the following: ...
0
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
14
by: Developer | last post by:
Hello All, i have recently installed VS2005 and was trying to install SQL sever 2000. I have Win XP' SP2. But when I tried installing, it only installed client tools and not the database. Can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.