Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to getHostName in swift? #12

Closed
ChoiSeungchan opened this issue Mar 28, 2017 · 16 comments
Closed

How to getHostName in swift? #12

ChoiSeungchan opened this issue Mar 28, 2017 · 16 comments

Comments

@ChoiSeungchan
Copy link

I tried get hostname in this code

func lanScanDidFindNewDevice(device: Device!) {
// print("This is Device : "+"(device)")
//Adding the found device in the array
if(device.brand.containsString("Apple")){
print("DeviceInfo : "+"(device.macAddressLabel())"+"(device.hostname)\n")
}
self.connectedDevices?.append(device)
}

but hostName is "nil"

I using swift 2.2 and xcode 7 and also I am beginner developer so I need your help
please tell me how can I get HostName

@NeverAgain11
Copy link

I also met this question, Did you solved it?

@mavris
Copy link
Owner

mavris commented May 5, 2017

Hi,
The getHostname function was not built by me. I noticed also that in some networks (eg. a network with Active Directory) shows the hostnames and in others is not showing. I think it has something to do with the type of DNS. If you find a more solid getHostname function please let me know or send me a pull request.

@jpalten
Copy link

jpalten commented May 29, 2017

Perhaps using MDNS or NBNS requests... I'll look into that.

@Sofianebenabdallah
Copy link

I have the same problem on some network. Some news about this ?

@Ketan-Wadyalkar
Copy link

I am facing the same issue, hostname is always empty. Any solution ?..

@fukemy
Copy link

fukemy commented Oct 18, 2018

same problem here, any updates?

@HussainTechGee
Copy link

I am facing the same issue, hostname getting empty on specific networks . Any solution? @Ketan-Wadyalkar @fukemy @Sofianebenabdallah

@fukemy
Copy link

fukemy commented Nov 22, 2018

hostname does not important than MAC address, after ios 11.4 this library does not help to get MAC, so i decided to leave

@HussainTechGee
Copy link

HussainTechGee commented Nov 22, 2018

Thanks for your significant time @fukemy .please recommend any other library for same functionality if you know about that

@fukemy
Copy link

fukemy commented Nov 22, 2018

sorry i am trying to find the library like that :(

@tanvishah912
Copy link

Anyone found any solution for getting host name?

@fukemy
Copy link

fukemy commented May 6, 2021

no solution here bro, the only way is searching for onvif camera ios

@tanvishah912
Copy link

@fukemy But how other apps on app store are able to get host names like Fing, Net Analyzer?

@fukemy
Copy link

fukemy commented May 6, 2021

may be it's were not blocked by Apple, i think so.

@Sofianebenabdallah
Copy link

Hey, last time I did it it was 2 years ago. Unfortunately, Apple blocked these data. I got these data from mdns. You may need to merge mmlan and mdns data

@sz-ashik440
Copy link

@Sofianebenabdallah can you give me a lead how to get data from mdns/mmlan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants