Alexis Huxley wrote:
jw@johannes2:~$ host student2 student2 has address 192.168.0.31I believe 'host' goes directly to /etc/resolv.conf to see what your DNS servers are.jw@johannes2:~$ ping student2 ping: unknown host student2But 'ping' goes through the 'normal' resolution process, the first step of which is looking in /etc/nsswitch.conf. There I suspect you don't have: hosts: files dns which is probably what you need.
Thanks, but my /etc/nsswitch.conf already has this set-up (not changed from debian's default values) and still it doesn't work:
/-- johannes2:/etc# more nsswitch.conf # /etc/nsswitch.conf # # Example configuration of GNU Name Service Switch functionality. # If you have the `glibc-doc' and `info' packages installed, try: # `info libc "Name Service Switch"' for information about this file. passwd: compat group: compat shadow: compat hosts: files dns networks: files protocols: db files services: db files ethers: db files rpc: db files netgroup: nis \--The problem seems to be that for internal hostnames it should query the first nameserver in resolv.conf (which runs dnsmaq), but apparently it queries the second and/or third which doesn't know the hostname.
For the host command it correctly queries the first nameserver, but for ping it wrongly queries the second or third nameserver in resolv.conf.
Johannes