I am working with an application where my iPhone needs to see my laptop on the network under its host name and not the IP address because the SSL certificate works with the name only. At the office, I resolved it by adding a DNS entry mapping my host to my IP and it works. But today I am WFH on my home network which does not have a DNS server capability.

I was wondering if I can somehow edit some hosts file on the iPhone (or some setting or something equivalent) so that the iPhone can see the laptop under its name. They are both on the same network and can reach each other via IP but the network has no DNS.

I also came upon this related material. Here are my pertinent settings:

>scutil --get ComputerName
>scutil --get HostName
HostName: not set
>scutil --get LocalHostName

1 Answer 1


You can edit the hosts file on the iOS device if the device is jailbroken.

The hosts file can be found in the same place as on OS X: /etc/hosts. It works exactly the same as the hosts file on OS X.

Set the hostname of your OS X machine using:

sudo scutil --set HostName your-hostname
  • do you think the scutil command can be used to enable visibility ? please see the edit to the OP i just made. thanks
    – amphibient
    Commented May 1, 2014 at 19:14
  • @amphibient You can set a hostname using the command I've edited in my answer. I'm not that familiar with scutil generally though.
    – grg
    Commented May 1, 2014 at 19:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .