Wi-Fi Sharing for Development, using the same IP addresses and domain names from /etc/hosts I want to share my Ethernet through a Wi-Fi connection. I'm also doing Xcode iOS development. I have a custom change in my /etc/hosts file for a host pointing to 127.0.0.1. In my application, I want to be able to connect to my Wi-Fi hotspot using the custom domain in my /etc/hosts.

Here is my /etc/hosts:

127.0.0.1   my.test.com


And in my app running on an iPad, I want to connect to my.test.com without error.

How is this possible?
Have used this for a while... Plex Connect DNS Server from here, you may redirect using the loop back idea. Make sure to change self.ip to the IP of the machine you are running the stuff off of. Change the Host intercept to whatever, and it will redirect to your "site" you run off your laptop for development. 

This will run on port 53, so anything else that could disrupt the service should be shut down. 

Below are the line numbers to add/remove your domains, the last is the interception of domain, the other two are for blocking unwanted hosts. 

 60-66
 333-336
 445


below are the lines to make changes to

        param['IP_self'] = '192.168.178.20'  # server ip here
        param['HostToIntercept'] = 'mydomain.com'


Note: Be sure to add the IP Address of the DNS Server to your test devices individually, also you may need to change the Self_IP located at the bottom of the script to your machine's IP, available by option-clicking the wifi button, or opening System Preferences -> Networking -> (Connection Name) -> Right hand side close to the top of the window.

Sources:  Personal Experience, PlexConnect, MiniDNS