Mikhail Morfikov
2016-01-07 16:25:42 UTC
I have the following entries set in the dnsmasq.conf file:
# egrep -v ^# /etc/dnsmasq.conf | egrep -v "^$"
domain-needed
bogus-priv
strict-order
no-resolv
no-poll
server=127.0.2.1#5353
server=/pool.ntp.org/208.67.222.222
server=/mhouse.lh/192.168.1.1#53
local=/mhouse.lh/
listen-address=127.0.0.1
no-dhcp-interface=lo
bind-interfaces
expand-hosts
domain=mhouse.lh
cache-size=10000
min-cache-ttl=3600
max-cache-ttl=7200
dns-forward-max=1024
no-negcache
So all of the DNS requests should go to the 127.0.2.1 address, except for the two domains. One of the domains is my local one (mhouse.lh), and all
the queries should go to my network router.
The whole setup works just fine, but the problems start when I try to
visit a domain that simply doesn't exist. For instance, dupaa.com . The
following log is from tcpdump:
15:45:32.035381 IP 127.0.0.1.18520 > 127.0.2.1.5353: 1536+ A (QM)? dupaa.com. (27)
15:45:37.040620 IP 127.0.0.1.18520 > 127.0.2.1.5353: 1536+ A (QM)? dupaa.com. (27)
15:45:38.045687 IP 127.0.2.1.5353 > 127.0.0.1.18520: 1536 ServFail 0/0/1 (38)
15:45:38.046118 IP 192.168.1.150.6289 > 192.168.1.1.53: 57153+ A? dupaa.com.mhouse.lh. (37)
So the query was sent to dnsmasq, then it was passed to the local DNS
service (dnscrypt-proxy), and it failed to resolve because the domain
doesn't exist. But this wasn't the end. For some reason, there was another
query, now with the local domain appended to the actual domain. I have no
idea why this happens.
This is my /etc/resolv.conf file:
nameserver 127.0.0.1
search mhouse.lh
The IP is the dnsmasq's IP, and the search should append the domain
"mhouse.lh" to queries that don't have any domain specified, for example,
when you use just hostnames. It's very useful thing in local networks.
When I remove the "search" line, the problem disappears, but I don't have
the ability to use just hostnames anymore. I could add them to the
/etc/hosts file, but I want to avoid this.
Is there any way to solve this problem?
# egrep -v ^# /etc/dnsmasq.conf | egrep -v "^$"
domain-needed
bogus-priv
strict-order
no-resolv
no-poll
server=127.0.2.1#5353
server=/pool.ntp.org/208.67.222.222
server=/mhouse.lh/192.168.1.1#53
local=/mhouse.lh/
listen-address=127.0.0.1
no-dhcp-interface=lo
bind-interfaces
expand-hosts
domain=mhouse.lh
cache-size=10000
min-cache-ttl=3600
max-cache-ttl=7200
dns-forward-max=1024
no-negcache
So all of the DNS requests should go to the 127.0.2.1 address, except for the two domains. One of the domains is my local one (mhouse.lh), and all
the queries should go to my network router.
The whole setup works just fine, but the problems start when I try to
visit a domain that simply doesn't exist. For instance, dupaa.com . The
following log is from tcpdump:
15:45:32.035381 IP 127.0.0.1.18520 > 127.0.2.1.5353: 1536+ A (QM)? dupaa.com. (27)
15:45:37.040620 IP 127.0.0.1.18520 > 127.0.2.1.5353: 1536+ A (QM)? dupaa.com. (27)
15:45:38.045687 IP 127.0.2.1.5353 > 127.0.0.1.18520: 1536 ServFail 0/0/1 (38)
15:45:38.046118 IP 192.168.1.150.6289 > 192.168.1.1.53: 57153+ A? dupaa.com.mhouse.lh. (37)
So the query was sent to dnsmasq, then it was passed to the local DNS
service (dnscrypt-proxy), and it failed to resolve because the domain
doesn't exist. But this wasn't the end. For some reason, there was another
query, now with the local domain appended to the actual domain. I have no
idea why this happens.
This is my /etc/resolv.conf file:
nameserver 127.0.0.1
search mhouse.lh
The IP is the dnsmasq's IP, and the search should append the domain
"mhouse.lh" to queries that don't have any domain specified, for example,
when you use just hostnames. It's very useful thing in local networks.
When I remove the "search" line, the problem disappears, but I don't have
the ability to use just hostnames anymore. I could add them to the
/etc/hosts file, but I want to avoid this.
Is there any way to solve this problem?