How to change DNS on hotspot

5,794

Changes on /etc/hosts file only affect the local machine.

Here is the problem: Assume that your wireless hotspot (or your router) is running DHCP and also act as local DNS. When you open browser and navigate to any webpage, your browser will first look at your etc/hosts to see if there is any match entry. If not, it will ask the local DNS running on your router/wireless hotspot. Unfortunately, there is no such entry like this on your local DNS. That's why your ipod failed to open www.mydomain.com

In order to achieve your goal, here is one option (unfortunately, it's not simple)

  1. Setup a DNS server on your laptop to resolve www.mydomain.com
  2. Config the DNS server to forward unknown query to your local DNS running on your router/wireless hotspot
  3. Change DHCP server on your router/wireless hotspot to return IP of your labtop in DCHP response

There are 2 potential problems with this solution:

  1. Your laptop must be running all the time
  2. You also need to config static IP for your laptop
Share:
5,794

Related videos on Youtube

Grey
Author by

Grey

client side developer on Android platform.

Updated on September 18, 2022

Comments

  • Grey
    Grey over 1 year

    I have a laptop with ubuntu installed, and i turn on wireless hotspot. On my laptop, i have a http server, and i changed /etc/hosts file, and change 127.0.0.1 and my ipaddress(the wireless card interface address) mapped www.myOwnDomain.com So when i use my brower on my laptop, when i type www.mydomain.com it will go to my HTTP server. That works perfect. However, my question is the ipod devices connect to my wirless thospot still can not resolve www.mydomain.com. Anyone knows what i am i missing?

    Thanks

  • Grey
    Grey almost 11 years
    thanks, that's also what i thought. i miss the dns server and static ip