Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On my phone, I'm pointing to my PC address for DNS server (dnsmasq), and it is working for normal DNS queries but not for local. I can see from a ping app that local domains are resolved to 127.0.0.1, and that's logical, but not what I want in this case. If I set a local domain's address to my PC, it works on both my PC and phone (etc/hosts: from 127.0.0.1 test.dev to 192.168.1.67 test.dev). I would like to work around this in different manner since I would be forced to edit the hosts file every time I change internet connections or the dhcp address gets released. As far as I understand, it has something to do with --localize-queries and /etc/hosts having multiple addresses, but I haven't found much information about this so I'm here, sorry if it's confusing and thanks in advance for any help.

Short version:

PC -> 192.168.1.67 phone DNS server (manually entered) -> 192.168.1.67

Then I hit /etc/hosts domain from PC, it resolves to 127.0.0.1, then I hit /etc/hosts domain from phone, it resolves to 192.168.1.67.

share|improve this question
    
i have tried adding rules in /etc/hosts/ like this 127.0.0.1 test.dev 192.168.1.67 test.dev and it seems that dnsmasq resolves it correctly without any special settings – Edmund24 Nov 17 '13 at 11:56
    
while trying replicate this setup on different i noticed that address=/xtgem.dev/192.168.1.67 in /etc/dnsmasq.conf is required to work the way i described above – Edmund24 Nov 19 '13 at 11:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.