Giter Site home page Giter Site logo

dnsserverapi's People

Contributors

garysharp avatar hyberdk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dnsserverapi's Issues

NS Record is deleted when trying to update it.

Hi Gary,

I think I found a bug in your code, but can you please check.. The steps I make to reproduce it is:

  1. create a new zone
  2. then update the SOA record with the information I need.
  3. then update the NS record that is automatically created by the MS DNS server.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.