如何让安卓手机访问内网服务器?

前提条件:

手机和虚拟机环境在同一个wifi网络下。

安装

sudo apt-get update
sudo apt-get install dnsmasq

将最后一行注释去掉

sudo vi /etc/dnsmasq.conf

497 # Include a another lot of configuration options.
498 #conf-file=/etc/dnsmasq.more.conf
499 conf-dir=/etc/dnsmasq.d

cd /etc/dnsmasq.d/

vi dns
1 address=/fairyin.pw/192.168.0.101
2 address=/www.fairyin.pw/192.168.0.101
3 address=/i.fairyin.pw/192.168.0.101
4 address=/s.fairyin.pw/192.168.0.101
5 address=/shop.fairyin.pw/192.168.0.101
6 address=/app.fairyin.pw/192.168.0.101

重启

sudo /etc/init.d/dnsmasq restart

posted @ 2014-12-22 15:23  Fairyin丶  阅读(2260)  评论(0编辑  收藏  举报