I searched through google.com but can't find an answer... So I asked here.
This is the problem:
I build a DNS test environment on my PC which hostname is gamepc
.
The DNS server (bind9) has a wildcard record:
* IN A 192.168.0.1
And the /etc/resolv.conf file has a entry:
domain bogus.
nameserver 127.0.0.1
So when I ping somehost
it will return like:
PING somehost.bogus (192.168.0.1) 56(84) bytes of data.
64 bytes from gamepc.bogus (192.168.0.1): icmp_req=1 ttl=64 time=0.042 ms
...
And when I ping google.com
it will return like:
PING google.com (74.125.71.99) 56(84) bytes of data.
64 bytes from hx-in-f99.1e100.net (74.125.71.99): icmp_req=1 ttl=51 time=68.0 ms
...
So far everything is good. But if I ping some non-exist domain e.g. sldfjsldjflksdjf.com
it will still return like:
PING sldfjsldjflksdjf.com.bogus (192.168.0.1) 56(84) bytes of data.
64 bytes from gamepc.bogus (192.168.0.1): icmp_req=1 ttl=64 time=0.043 ms
...
And the expected result should be:
ping: unknown host sldfjslkdfjlksdjfklsdjf.com
I can thought how this happened. At first the resolver try sldfjslkdfjlksdjfklsdjf.com
but get a NXDOMAIN
response. Then it append the domain part and try sldfjslkdfjlksdjfklsdjf.com.bogus
again. This time the host name match the wildcard record in DNS server and return 192.168.0.1
...
Does anyone have the same issue? And how did you resolve it?
Thank you very much for reading!