前提条件:

手机和虚拟机环境在同一个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

相关文章:

  • 2021-04-15
  • 2021-11-12
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-08-30
  • 2021-04-08
猜你喜欢
  • 2021-07-03
  • 2021-10-27
  • 2021-04-18
  • 2021-09-20
  • 2021-06-23
  • 2022-12-23
  • 2021-07-06
相关资源
相似解决方案