1

04 I am trying to config wildcard in the host file

127.0.0.1 *.example.com

so i installed dnsmasq I have tried

echo address=/example/127.0.0.1/ | sudo tee -a /etc/NetworkManager/dnsmasq.d/local
echo address=/.example/127.0.0.1/ | sudo tee -a /etc/NetworkManager/dnsmasq.d/local
sudo /etc/init.d/dnsmasq restart
sudo service network-manager restart

followed answers of:

Wildcard Virtual Hosts Ubuntu

But nothing has worked so far.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Al-Alamin
  • 1,438
  • 2
  • 15
  • 34

2 Answers2

0

what you can do is

sudo echo 'address=/example.com/127.0.0.1'  >> /etc/dnsmasq.conf

is equivalent to

*.example.com

or

*.*.*.example.com

and restart the dnsmasq service

sudo /etc/init.d/dnsmasq restart

I think this will do the trick.

  • I did it but the problem still persisted for some unknown reason. After restarting my pc it was working for reason – Al-Alamin Dec 10 '17 at 02:43
0

For some unknown reason even after restarting network-manager and dnsmasq the problem was not solved. But after restarting my PC it was working fine.

Al-Alamin
  • 1,438
  • 2
  • 15
  • 34