Skip to content

Cant resolve hostnames #209

Closed
Closed

Description

@WattsC-90

Describe your issue:
I was using version 1.6.1 for a long time, with no issues (mainly used it for the IP scanner to see which hostnames/IPs were active. I thought I would update to version 1.10.0 (and now 1.11.1), but it seems like the hostname resolution has stopped working, I can no longer resolve any hostnames for IP addresses that are found in the specified ranges.

image

Version 1.6 (which I had downloaded and run standalone) shows the hostnames correctly when scanning.

If I right click and use DNS Lookup menu, then IPAddress is available, but Hostname is grayed out:
image

Running on Windows Enterprise 1809, i dont know what other info you need.. please ask and ill update this question.

Activity

  1. BornToBeRoot commented on Aug 13, 2019

    @BornToBeRoot
    Owner

    Since version 1.6.3, i am using Heijden.DNS instead of the .NET default method to resolve the hostname from an ip address.

    Can you check these settings:

    image

    This should automatically detect the dns server configured in windows... Try to set the dns server manually with Use custom DNS server.

  2. WattsC-90 commented on Aug 14, 2019

    @WattsC-90
    Author

    So neither seem to do anything? I had configured the custom dns already but not added the other network (in this case 192.168.4.1 is my router.. so added that one), but its not changed anything.. it was already pointing at the right corporate DNS servers, but not showing the Hostnames (different ip range to the one being shown above). Any other ideas?

  3. BornToBeRoot commented on Aug 14, 2019

    @BornToBeRoot
    Owner

    You could check with nslookup.exe 192.168.4.1 if a PTR is resolved for this IP address, when you query your corporate DNS server.

    Edit: You could reset the settings by deleting the file %appdata%\NETworkManager\Settings\Settings.xml

  4. BornToBeRoot commented on Sep 24, 2019

    @BornToBeRoot
    Owner

    @brucechaser

    Can you test the "DNS Lookup" in the NETworkManager if you can resolve the PTR record for one of these ip addresses...

    By default, the tool detects the windows dns server (you can overwrite this option in the settings)

    Which DNS server are you using (Router like FritzBox or Netgear, Windows Server, etc.)???

  5. WattsC-90 commented on Sep 24, 2019

    @WattsC-90
    Author

    @BornToBeRoot , i never got this to work, the settings you mentioned in your comment were already configured to the right dns settings for my network. I just used the old version instead, takes a bit longer but it works

  6. BornToBeRoot commented on Sep 25, 2019

    @BornToBeRoot
    Owner

    Actually it does not resolve all the host names as Advanced IP Scanner

    Advanced IP Scanner also resolves NETBIOS.

    I try to replace Heijden.DNS with DnsClient in the next version. Heijden.DNS won't get any updates and i added some custom fixes to make it work with IPv6 dns servers...

    I post a preview version here, once i have it implemented... so you can test it in your environment.

    https://github.com/MichaCo/DnsClient.NET
    https://www.nuget.org/packages/DnsClient/

  7. BornToBeRoot commented on Sep 28, 2019

    @BornToBeRoot
    Owner

    @brucechaser @WattsC-90 Can you test this version and give me feedback? It should use the default windows dns server... user settings are ignored.

    NETworkManager_v2_2019_09_28_DnsClient_Portable.zip

  8. added a commit that references this issue on Sep 28, 2019
  9. WattsC-90 commented on Sep 28, 2019

    @WattsC-90
    Author

    Thanks! Ill give it a go on monday as it struggles on the work network architecture, ill try give it a go at home too just to make sure its working in a more basic environment! Thanks again for your work on this.

  10. BornToBeRoot commented on Oct 2, 2019

    @BornToBeRoot
    Owner

    does it work?

  11. WattsC-90 commented on Oct 2, 2019

    @WattsC-90
    Author

    I had forgotten.. trying it now..

  12. 1 remaining item

  13. BornToBeRoot commented on Oct 2, 2019

    @BornToBeRoot
    Owner

    I could reproduce the issue... i upload a new version this evening...

  14. added a commit that references this issue on Oct 2, 2019
  15. BornToBeRoot commented on Oct 2, 2019

    @BornToBeRoot
    Owner

    @WattsC-90 @brucechaser can you test this version and give me feedback? Thanks!

    NETworkManager_Issue209_v2.zip

  16. WattsC-90 commented on Oct 3, 2019

    @WattsC-90
    Author

    So I feel like were getting somewhere... still getting errors but its failing fast.
    Fortunately these are all private networks so I can share the screenshots!!

    image

    Which source file has your DNS lookup code? I was trying to find it but couldnt find the type LookupClient? I want to see what youre doing and if I can find a solution that works.. or a better idea why its not working..

  17. BornToBeRoot commented on Oct 3, 2019

    @BornToBeRoot
    Owner

    Here is the LookupClient for the IP scanner

    DnsLookupClient = UseCustomDNSServer ? new LookupClient(new IPEndPoint(CustomDNSServer, CustomDNSPort)) : new LookupClient();

    This is the query:

    var dnsQueryResponse = DnsLookupClient.QueryReverse(ipAddress);

    The DNS server 160.100.160.254 Port 53 and 162.118.144.233 Port 53 are correct?

  18. WattsC-90 commented on Oct 3, 2019

    @WattsC-90
    Author

    @BornToBeRoot Ta, saw the query line, cant find the LookupClient object/type is it in a nuget? or in the repo?

  19. WattsC-90 commented on Oct 3, 2019

    @WattsC-90
    Author

    Ta, had a look.. no idea why it throws these errors.. its intermittent between ServerFailure and the shown Error: No connection could be established to any of the following name servers... issue..

    Can I ask, whats the downside with DNS.GetHostEntry(ip)?

  20. BornToBeRoot commented on Oct 3, 2019

    @BornToBeRoot
    Owner

    With DNS.GetHostEntry(ip)? you can't set a custom dns server... it always use the windows dns.

    I can add an option that DNS.GetHostEntry can be used as fallback.

    Edit: At least i replaced the Heijden.DNS... it's not suported anymore...

  21. WattsC-90 commented on Oct 3, 2019

    @WattsC-90
    Author

    ...https://www.codeproject.com/Articles/23673/DNS-NET-Resolver-C <uses Heijden DNS :(
    maybe?
    pain to write your own, but it looks like it would be versatile.. didnt realise you couldnt specify your own dns servers, hadnt tried before..

    not sure if WMI would allow you to

  22. BornToBeRoot commented on Oct 3, 2019

    @BornToBeRoot
    Owner

    I think it doesn't make sense to write my own dns resolver, when there are well tested libaries available. DnsClient.NET has 7 million downloads on nuget, so the most bugs are fixed and it is stable. And then i still can't test agains your dns server...

    With WMI you can query / set windows specific settings.

    The best to make it work, would be a fallback option to use DNS.GetHostEntry... But with the default .NET dns resolver, you can't set custom dns, timeout, retries...

  23. MichaConrad commented on Oct 8, 2019

    @MichaConrad

    Hey, jumping in here out of the blue, trying to help ^^

    The error No connection could be established to any of the following name servers really means what it says, the DnsClient's LookupClient couldn't connect to the server on port 53 via UDP.
    Maybe that's blocked by your local firewall or the server is dead or not reachable from your network...

    There are a couple of things you can try, for example dig or nslookup

    Doing a reverse lookup via dig would look like this: dig @160.100.160.254 -x <ip>
    If that fails, then its your network having issues to access that server and there is no problem with the code.

  24. WattsC-90 commented on Oct 8, 2019

    @WattsC-90
    Author

    @MichaCo Thanks for the jump in, im stuck! As you know from my question on DNSclient.net project it just doesnt work where the windows one does.. our DNS servers work.. theyre just corporate versions.. if DNS didnt work we would be stuffed! what I cant find any information out on is how the windows version differs to yours/others?

  25. MichaConrad commented on Oct 8, 2019

    @MichaConrad

    @WattsC-90 did you try to query your DNS servers with tools like dig or nslookup via command line?
    The windows subsystem for linux is pretty handy for those kind of tests because you can use dig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions