I am trying to get the domain name of my macbook pro using following method.
NSString *name = [[NSHost currentHost] name];
It returns me the name like 'The-Special-MBP.local' but this is not consistent, It returns me some other string sometimes.
I am not getting why is this happening, the same function call returns two different values at different times.
Basically I need to indicate the different machines in network with some unique id or string hence I am reading the name from NSHost class but it gives different values for same machine.
Any help is appreciated.