0

I am using 2 interfaces on my computer, eth0 grants access to the outside world and wlan0 is where the Access Point is set up.

My configuration is based on 2 networks 192.168.1.0 on eth0 and 10.0.0.0 on wlan0. I have a dhcp server that hands IP's for the network 10.0.0.0 and there, I have as DNS my ip of wlan0 (10.0.0.1) and 8.8.8.8.

When I connect with other device to the network, everything works fine, I have my IP address, I am redirected to the outside world from wlan0 to eth0 by iptables BUT I want to spoof the DNS. And here is my doubt. How do I do that¿? I have read about dnsmasq, working as both DHCP server and DNS, but on my config, what would be the interface of the DNS, wlan0¿?

I hope I made myself clear, if anyone can help me I would really appreciate, and I would also appreciate if someone could through some light with this. I am a little bit confused on how a DNS server on a wlan0 interface that has no access to the internet can act as DNS.

1 Answer 1

1

It should be wlan0. Your setup should open up port 53 on the wlan0. Once a client makes a DNS resolution request, the DNS server should recursively resolve it using the regular Internet path (eth0).

2
  • Thank you very much for your answer. So to make sure I understood: My DNS are resolved acording to the file /etc/resolv, there I have 192.168.1.1 (where I am connected through eth0), so, I don't have a DNS server, when users connect to my access point, their DNS are gonna be resolve by 192.168.1.1, but, if I have a DNS server on wlan0, the users that connect to me, uses with priority my "hosts" example, if I have 10.0.0.1 facebook.com, when they go to facebook they go to my IP, and for the rest IPs they use my /etc/resolv don't they¿? Thank u
    – aDoN
    Nov 7, 2014 at 8:15
  • Mostly. But for the part where the DNS needs to be resolved, you need to have a DNS server. All DNS queries on wlan0 will be resolved only then. And to resolve the DNS queries, the DNS recursive server (like djbdns or BIND) will make independent recursive queries (unrelated to your local resolver, as in /etc/resolv.conf).
    – sandyp
    Nov 7, 2014 at 21:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.