garysharp / dnsserverapi Goto Github PK
View Code? Open in Web Editor NEWGeneric DNS Server querying and management
License: MIT License
Generic DNS Server querying and management
License: MIT License
Hi Gary,
I think I found a bug in your code, but can you please check.. The steps I make to reproduce it is:
When I update the NS record and it invokes the var wmiResult = instance.InvokeMethod("Modify", wmiParams, null);
the record is deleted on the server. It updates the SOA record fine.
The function is this one:
public static void ModifyRecordInternal(this WindowsDnsZone zone, DnsRecord record)
{
if (zone == null)
throw new ArgumentNullException(nameof(zone));
if (record == null)
throw new ArgumentNullException(nameof(record));
var state = zone.GetRecordStateInternal(record);
if (state == null)
throw new ArgumentException("Record must be created by the provider");
using (var instance = zone.server.WmiGetInstance(state.WmiPath))
{
using (var wmiParams = instance.GetMethodParameters("Modify"))
{
wmiParams["TTL"] = (uint)record.TimeToLive.TotalSeconds;
// populate record-specific parameters
PopulateRecordParameters(zone, record, wmiParams);
var wmiResult = instance.InvokeMethod("Modify", wmiParams, null);
var wmiPath = (string)wmiResult["RR"];
var newState = new WindowsDnsRecordState(wmiPath);
zone.SetRecordStateInternal(record, newState);
}
}
}
on a side note, should your code automatically update the NS record (if needed) when the SOA record is updated or what is your take on that?
Let me know if you want TCPdumps of the actual traffic.
Esben
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.