1.1.1.1 testand then you ask with nslookup within guest machine for that name, you'll receive:
# nslookup testNote that localdomain is automatically appended. This is specified with search directive in /etc/resolv.conf of guest machine (there is a line search localdomain or something similar). Otherwise, without localdomain, the name wouldn't be found:
Server: 192.168.178.2
Address: 192.168.178.2#53
Name: test.localdomain
Address: 1.1.1.1
# nslookup test.
Server: 192.168.178.2
Address: 192.168.178.2#53
** server can't find test.: NXDOMAIN
In this example, the dot I appended after the name prevents anything from being appended and only name test is looked for.
To conclude, the rule is simple. If the name to be looked up ends with localdomain, then it is searched within /etc/hosts file of the host operating system.
I discovered this by accident. Namely, I did nslookup within guest machine expecting to receive error message about non-existing host name, but I got good response!? At first, I was confused, and it took me several minutes to figure out what's happening. Well, so the things go when you don't read manuals. ;)
No comments:
Post a Comment