We help IT Professionals succeed at work.

How to create a dns record via active directory

Chrissalter
Chrissalter asked
on
Does anybody know how to create a valid dns record in the active directory?

I can get the record to show up in adsiedit using the attached code, and all attributes are identical apart from the actual dnsRecord property but the record does not appear in microsoft dns

can anyone shed any light?
Dim base As String = "LDAP://DC=******.co.uk,CN=MicrosoftDNS,dc=domaindnszones,DC=*****,DC=co,DC=uk"

Dim ent = New DirectoryEntry(base, "username", "password")

        Dim de = ent.Children.Add("DC=testing", "dnsNode")
        'not sure what to put so just try an ip address
        de.Properties("dnsRecord").Add("192.168.0.150")

        de.CommitChanges()

Open in new window

Comment
Watch Question

Hello

Why you don't try with "dnscmd /recordadd". If not you have some powershell script here
http://forums.iis.net/t/1159299.aspx

Dan

Author

Commented:
yeah i did try dnscmd but this will be getting fired from a asp.net page and i kept getting an access is denied message,

i did see a post on using wmi but at the time couldnt really get my head around it and with the rest of the project being based around directoryservices i wanted to try and limit the technologies in use

but i will have a look at the link you posted, thankyou

Author

Commented:
The supplied link sent me in the right direction