Coder Social home page Coder Social logo

rmbolger / dnsclient-ps Goto Github PK

View Code? Open in Web Editor NEW
31.0 3.0 1.0 252 KB

A cross-platform DNS client for PowerShell utilizing the DnsClient.NET library.

License: MIT License

PowerShell 100.00%
dns resolver dnsclient powershell powershell-module powershell-core dns-client dns-resolver dig nslookup

dnsclient-ps's People

Contributors

rmbolger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dnsclient-ps's Issues

The 'Address' property under the 'Answer'/'RecordData' seems to be inaccessible

$(Resolve-Dns -NameServer $dnsServer -Query $FQDNsToQueryFor  | Select-Object -Expand Answers)                          

DomainName                         TimeToLive RecordClass RecordType RecordData
----------                         ---------- ----------- ---------- ----------
api.monitor.azure.com.             192        IN          CNAME      api.privatelink.monitor.azure.com.
api.privatelink.monitor.azure.com. 9          IN          A          SCRUBBED

However when trying to reference the 'RecordData' property/column I get a null value

$(Resolve-Dns -NameServer $dnsServer -Query $FQDNsToQueryFor  | Select-Object -Expand Answers).RecordData

I wanted to do some further digging and tried the following command:

$((Resolve-Dns -NameServer $dnsServer -Query $FQDNsToQueryFor  | Select-Object -Expand Answers) | Select-Object -Property *)                             

CanonicalName     : api.privatelink.monitor.azure.com.
DomainName        : api.monitor.azure.com.
RecordType        : CNAME
RecordClass       : IN
TimeToLive        : 63
InitialTimeToLive : 63
RawDataLength     : 18

Address           : SCRUBBED
DomainName        : api.privatelink.monitor.azure.com.
RecordType        : A
RecordClass       : IN
TimeToLive        : 0
InitialTimeToLive : 0
RawDataLength     : 4

So then I tried to reference the 'Address' Property of the Object in the Array, but got a weird Result...

$((Resolve-Dns -NameServer $dnsServer -Query $FQDNsToQueryFor  | Select-Object -Expand Answers) | Select-Object -Property *).Address

OverloadDefinitions
-------------------
System.Object&, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e Address(int )

I did a little digging and found that the property Name for 'Address' might cause some problems, it doesn't seem to be a Reserved word, but the Address METHOD seems to supersede calling the property? I don't know if I am using proper terminology as I am newer to C# and PowerShell scripting, but you may be able to understand.

Here is the relevant PowerShell issue that is actually still open.
PowerShell/PowerShell#8105

resolve-dns throw a powershell error with non existent domain

As the tile said, the module throw a powershell error and not a "inexistent domain" with an inexistent domain.

Ex:

⮞  resolve-dns xttox.com`
MethodInvocationException: C:\Users\exp1x835\OneDrive - Beneva\Documents\PowerShell\Modules\DnsClient-PS\1.1.1\Public\Resolve-Dns.ps1:78`

Line |
  78 |                  $client.QueryServer($nsList, $qst)
     |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "QueryServer" with "2" argument(s): "Query 42931 => xttox.com IN A on
     | 96.45.46.46:53 timed out or is a transient error."

Not working on Windows PowerShell

When I tested the module, it works in PowerShell 7 but fails in Windows PowerShell.
With any cmdlet, I get this exception:

Exception calling "QueryServer" with "2" argument(s): "Query 59746 =>
8.8.8.8.in-addr.arpa. IN PTR on 192.168.2.1:53 failed with an error."
At C:\Users\tobia\OneDrive\Dokumente\WindowsPowerShell\Modules\DnsClient-
PS\1.1.0\Public\Resolve-Dns.ps1:78 char:17
+                 $client.QueryServer($nsList, $qst)
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationExce
   ption
    + FullyQualifiedErrorId : DnsResponseException

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.