host/dig/nslookup resolving differently from ping, wget, firefox


I can’t ping my host by fdqn. I want to use that rather than just the hostname.


nmarks@linux-e0f3:/proc/6364/net> ping gndev-infra-01.gndev.local
ping: unknown host gndev-infra-01.gndev.local


It works if i ping using just the hostname.


nmarks@linux-e0f3:/proc/6364/net> ping gndev-infra-01
PING gndev-infra-01.gndev.local (192.168.1.50) 56(84) bytes of data.
64 bytes from gndev-infra-01.gndev.local (192.168.1.50): icmp_seq=1 ttl=64 time=0.232 ms
64 bytes from gndev-infra-01.gndev.local (192.168.1.50): icmp_seq=2 ttl=64 time=0.180 ms
^C
— gndev-infra-01.gndev.local ping statistics —
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.180/0.206/0.232/0.026 ms


You would think i have a search base that’s appending, but I don’t
think I do (according to resolv.conf below)


nmarks@linux-e0f3:/proc/6364/net> more /etc/resolv.conf

/etc/resolv.conf file autogenerated by netconfig!

Before you change this file manually, consider to define the

static DNS configuration using the following variables in the

/etc/sysconfig/network/config file:

NETCONFIG_DNS_STATIC_SEARCHLIST

NETCONFIG_DNS_STATIC_SERVERS

NETCONFIG_DNS_FORWARDER

or disable DNS configuration updates via netconfig by setting:

NETCONFIG_DNS_POLICY=’’

See also the netconfig(8) manual page and other documentation.

Note: Manual change of this file disables netconfig too, but

may get lost when this file contains comments or empty lines

only, the netconfig settings are same with settings in this

file and in case of a “netconfig update -f” call.

Please remove (at least) this line when you modify the file!

nameserver 192.168.1.253


stragner still, host -v produces the results I want and expect
it fails on the hostname


nmarks@linux-e0f3:/proc/6364/net> host -v gndev-infra-01
Trying “gndev-infra-01”
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60102
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0

;; QUESTION SECTION:
;gndev-infra-01. IN A

;; ANSWER SECTION:
gndev-infra-01. 0 IN A 67.215.65.132

;; AUTHORITY SECTION:
. 448992 IN NS l.root-servers.net.
. 448992 IN NS m.root-servers.net.
. 448992 IN NS a.root-servers.net.
. 448992 IN NS b.root-servers.net.
. 448992 IN NS c.root-servers.net.
. 448992 IN NS d.root-servers.net.
. 448992 IN NS e.root-servers.net.
. 448992 IN NS f.root-servers.net.
. 448992 IN NS g.root-servers.net.
. 448992 IN NS h.root-servers.net.
. 448992 IN NS i.root-servers.net.
. 448992 IN NS j.root-servers.net.
. 448992 IN NS k.root-servers.net.

Received 259 bytes from 192.168.1.253#53 in 126 ms
Trying “gndev-infra-01”
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24110
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;gndev-infra-01. IN AAAA

Received 32 bytes from 192.168.1.253#53 in 14 ms
Trying “gndev-infra-01”
Host gndev-infra-01 not found: 3(NXDOMAIN)
Received 32 bytes from 192.168.1.253#53 in 14 ms


but succeeds on the FQDN


nmarks@linux-e0f3:/proc/6364/net> host -v gndev-infra-01.gndev.local
Trying “gndev-infra-01.gndev.local”
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49393
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;gndev-infra-01.gndev.local. IN A

;; ANSWER SECTION:
gndev-infra-01.gndev.local. 38241 IN A 192.168.1.50

Received 60 bytes from 192.168.1.253#53 in 1 ms
Trying “gndev-infra-01.gndev.local”
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60669
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;gndev-infra-01.gndev.local. IN AAAA

Received 44 bytes from 192.168.1.253#53 in 1 ms
Trying “gndev-infra-01.gndev.local”
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 98
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;gndev-infra-01.gndev.local. IN MX

;; AUTHORITY SECTION:
gndev.local. 38400 IN SOA gndev-infra-01.gndev.local. admin.gndev.local. 2007020400 10800 3600 604800 86400

Received 86 bytes from 192.168.1.253#53 in 1 ms


i don’t see anything in nsswitch


nmarks@linux-e0f3:/proc/6364/net> more /etc/nsswitch.conf

/etc/nsswitch.conf

An example Name Service Switch config file. This file should be

sorted with the most-used services at the beginning.

The entry ‘[NOTFOUND=return]’ means that the search for an

entry should stop if the search in the previous entry turned

up nothing. Note that if the search failed due to some other reason

(like no NIS server responding) then the search continues with the

next entry.

Legal entries are:

compat Use compatibility setup

nisplus Use NIS+ (NIS version 3)

nis Use NIS (NIS version 2), also called YP

dns Use DNS (Domain Name Service)

files Use the local files

[NOTFOUND=return] Stop searching if not found so far

For more information, please read the nsswitch.conf.5 manual page.

passwd: files nis

shadow: files nis

group: files nis

passwd: compat
group: compat

hosts: files mdns4_minimal [NOTFOUND=return] dns
networks: files dns

services: files
protocols: files
rpc: files
ethers: files
netmasks: files
netgroup: files nis
publickey: files

bootparams: files
automount: files nis
aliases: files


and of course all my other applications fail the way that ping does
(firefox, wget, etc)


ANY TIPS?

Don’t use .local as the TLD. It’s reserved for mDNS and lookups will get interfered with by it. A workaround is to set “mdns off” in /etc/host.conf. It seems this is not documented in the very old man page that openSUSE supplies for host.conf but you can search for it on the Net.

This choice of .local in mDNS seems to have tripped up many people, but also honestly there is so much choice for a local TLD. A family name would usually work unless you are Dr. No or something like that. :slight_smile: