Closed Septolum closed 8 years ago
Hostnames are fetched now during a host scan, are you talking about something different from that? Do you mean that you'd like a feature where you can enter in a hostname and it'll give you back an IP?
Oh, are they? I can't see any when I do a scan, and I believe I'm using the latest version
Although I can imagine that feature may be useful to people :)
Hmm, that's strange. If you look at the third screenshot here you can see examples of hostnames that should come up https://play.google.com/store/apps/details?id=com.aaronjwood.portauthority.free&hl=en
You can see that I'm getting the hostname here https://github.com/aaronjwood/PortAuthority/blob/master/app/src/main/java/com/aaronjwood/portauthority/async/GetHostnameAsyncTask.java#L35
It's possible that your environment might be setup incorrectly or in such a way that it won't be possible to resolve names. I've heard that name resolution can also fail in a few other cases like when CNAMEs are in use but you're trying to resolve an IP to a name (which is what I'm doing), not the other way around. Multihomed hosts can also present an issue I think.
Would you be able to confirm if you can resolve hostnames from IP addresses in your environment using other tools? I haven't seen this fail for anyone else yet so I'm not sure what it could be...
Yes, I can confirm there are hostnames for some of the ip's it has found using an ip scanner on my computer and another one on my phone. Where the hostname should be in port authority is just the ip address, same as the one directly below it
Okay, thanks for verifying that. I'll look into this more.
Would you mind attaching a screenshot? Also could you let me know what version of Android you're running, what your phone is, etc.?
Not at all
My apologies, it didn't seem to work with an email attachment
No worries, thanks for the screenshot! Can you tell me your OS version, phone model, etc?
4.4.2, Cubot S208 (obscure chinese cheap decent spec(processor equiv samsung s3)), Stock rom, running dalvik, Wpa/Wpa2 psk access point
Thanks! I'll follow up with you once I get some time to dig into this.
Thanks, no rush! :)
I haven't been able to reproduce this. Would it be possible for you to try the application on a different device within the same network that you initially scanned on? Another thing would be to try the host scan on a different network than the one you initially scanned.
Also, could you tell me what your phone is using for DNS servers? You can use the first four options of this to see what they are https://support.opendns.com/entries/42848890-Android-Configuration-instructions-for-OpenDNS
Dns 1: 192.168.1.254 Dns 2: 8.8.4.4 (grayed out) Happens on all networks I try I can't test it on another device at the moment, my only other android is a HTC wildfire, and it won't install due to the api requirements, I'll let you know if I get a chance to test it on another device
Thanks. Is 192.168.1.254 your gateway? Looks a little suspicious since most non-customized setups have 192.168.1.1 as the default gateway. I'll continue to look into this.
It's a bt home hub 3.0 if that's any help
Hmm, were all the networks you tried this on using that same device? I found some interesting info on the BT HH V3: https://community.bt.com/t5/Other-Broadband-Queries/BT-Home-Hub-V3-DNS-problem/td-p/666644 https://community.bt.com/t5/Other-Broadband-Queries/Home-Hub-3-Firmware-update-stops-DNS-queries-and-management-web/td-p/1208659
Not to say that's the underlying problem but there seems to be a decent amount of talk about DNS issues with that device. Is there anyway you can do a scan on a network that's not using this device?
No, just my home one. The college network I scanned on uses an aerohive setup and the hostnames didn't show then. Weird thing is that every other port scan I've done using my computer or a different app on my phone came up with hostnames
Okay, definitely an issue with something I'm doing in the code then. Thanks for running through all that with me.
No problem, happy to help :)
Just tested it on another device, still no hostnames on my network
Gah, this issue is going to be a pain :) Thanks for testing it on something else. When you click on a host after the host scan finishes and it brings you to the screen where you can scan ports, are you able to see the hostname there?
No, just lists the ip where the hostname should be
Interesting. It sounds like reverse DNS lookups aren't working at all for you. I actually don't know of another way to do the reverse lookup in Java without trying to go to a lower level with JNI or something. Is your other device running the same Android version by chance?
I believe it is, yes The odd thing is that hostnames are visible when I scan on my phone using fing http://goo.gl/GiFVE
I just deployed a new version to Google Play. Should be available in a few hours. When you get the update could you let me know if the issue got fixed? I'm making calls to getCanonicalHostName()
now instead of getHostName()
which I probably should have done in the first place.
I might be a bit slow getting it as I'm an f droid user, but I'll let you know when I do (or when I get bored of waiting and compile it myself)
Just updated, no luck unfortunately, still no hostnames :/
Okay, sorry about that. Let me look into this for a bit and see what I can do.
Don't worry about it, thanks :)
What I think will solve this issue is implementing NetBIOS/WINS resolution in addition to DNS resolution. I'm working on implementing this for the next major version (along with a bunch of other things). It should at least help for environments where DNS is not configured or provided by the router. Look for NetBIOS/WINS support in 1.6
Just rolled out 1.6. Let me know how it works out for you.
Apologies for the late reply, but it now works! Hostnames are visible for those devices that have them and are displayed in the correct place Thanks for your continued work :)
No worries, very glad to hear that it works now! :)
Is it possible to add hostname support? It would be really useful, eg finding a specific computer that has a variable IP address