Build a dnsmasq as DNS resolver[First]

I somehow want to access to my developing websites locally from my smartphone so investigated and wrote a memo.
Once access to local network, I can access to the website from my iPodTouch by typing ip address indicate my mac.
However iOS doesn’t rewrite hosts file, so it doesn’t access the websites over the reverse proxy, it means Nginx, working on the mac.
First, I thought to solve the problem by BIND, but more easy way was detected.
As Mac, use DNSMASQ.
This is available to resolve name from the /etc/hosts file so it’s convenient.
In my case, install it from homebrew.

sudo brew install dnsmasq
touch /usr/local/etc/dnsmasq.conf
sudo ln -s /usr/local/etc/dnsmasq.conf /etc/dnsmasq.conf

In any point of the above sequence, you may ask the question DNS port open or not, then you have to toggle yes.
#symlink of /etc is my favorite

write the below to /etc/dnsmasq.conf(/usr/local/etc/dnsmasq.conf)


/etc/hosts was like the below   en.axtstar.mymac

Previously check your mac IP address by ifconfig or something.
en.axtstar.mymac is the DOMAIN you should resolve.
So your iphone access to private webserver by safari(Of course, you have to change the DNS address on your iphone. see the next.)

Developing, almost hosts files are somehow like the below   en.axtstar.local
However even if change actual address indicate your mac, it doesn't work from mac/iphone.
".local" seems a system preserved name.
Android also partly didn't work.

The last things to do is start DNS server.

sudo brew services start dnsmasq
sudo brew services stop dnsmasq
sudo brew services restart dnsmasq