Re: How to resolve names



Sir Jackery wrote:

On Mon, 19 Mar 2007, Norbert Kolvenbach wrote:

Ian Northeast wrote:

On Sun, 18 Mar 2007 17:56:35 +0100, Norbert Kolvenbach wrote:

Dear experts,

this is possibly a very dumb problem/question and that may be the
reason I do not get a resolution.

i have 3 Linux pc connected to the internet via WLAN DSL router. 2 are
conencted via WLAN one is directly connected via LAN cable. The router
uses DHCP to assign dynamic IP addresses.

So I can ping and try to ssh/telnet the 2 other machines from my PC via
ip-address (no supprise).

I cannot do it by using their host names although I get proper
name/address resolution via nslookup.

As it stands this doesn't add up. If ping etc. by IP works and nslookup
of the names works (nslookup is a broken and outdated tool BTW, you
should use dig instead, but its brokenness does not extend to returning
answers when none are available) then ping etc. by name should too.

I assume that the router is acting as the DNS server, can you confirm
this?

Yes. Router is DNS and DHCP server


What output/errors are issued when you:

ping <name>

ping: unknown host <name>


dig <name>
~> dig <name>

; <<>> DiG 9.3.2 <<>> debach
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5425
;; flags: qr aa ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;debach. IN A

;; ANSWER SECTION:
<name>. 10 IN A 192.168.2.101

;; Query time: 1 msec
;; SERVER: 192.168.2.1#53(192.168.2.1)
;; WHEN: Mon Mar 19 17:48:01 2007
;; MSG SIZE rcvd: 46


host <name>
~> host <name>
<name> has address 192.168.2.101
Host <name> not found: 3(NXDOMAIN)
Host <name> not found: 3(NXDOMAIN)


getent hosts <name>

~>getent hosts <name>
~>
zero oputput!



Note that dig does not append the domain name specified in
/etc/resolv.conf, you have to include it in the command, i.e. dig
<host>.<domain>.

what is in /etc/resolv.conf?

cat /etc/resolv.conf
### BEGIN INFO
#
# Modified_by: dhcpcd
# Backup: /etc/resolv.conf.saved.by.dhcpcd.eth0
# Process: dhcpcd
# Process_id: 2644
# Script: /sbin/modify_resolvconf
# Saveto:
# Info: This is a temporary resolv.conf created by service
# dhcpcd.
# The previous file has been saved and will be restored
# later.
#
# If you don't like your resolv.conf to be changed, you
# can set MODIFY_{RESOLV,NAMED}_CONF_DYNAMICALLY=no. This
# variables are placed in /etc/sysconfig/network/config.
#
# You can also configure service dhcpcd not to modify it.
#
# If you don't like dhcpcd to change your nameserver
# settings
# then either set DHCLIENT_MODIFY_RESOLV_CONF=no
# in /etc/sysconfig/network/dhcp, or
# set MODIFY_RESOLV_CONF_DYNAMICALLY=no in
# /etc/sysconfig/network/config or (manually) use dhcpcd
# with -R. If you only want to keep your searchlist, set
# DHCLIENT_KEEP_SEARCHLIST=yes in
# /etc/sysconfig/network/dhcp
or
# (manually) use the -K option.
#
### END INFO
domain localdomain
nameserver 192.168.2.1
~>

What does the "hosts:" entry in
/etc/nsswitch.conf read?

cat /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 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

~>

Regards, Ian

That's the infroamtion which you ask for. Does this give an indication?

Thanks for helping and looking into it!

NoKo


What do your DNS server config files look like (the ones in that are
probably in /var/named and /etc/named.conf or whatever files you are
using) Your DNS server is 192.168.2.1 right?

Yes, and it is a plug and play box with a web interface and firmware. I
cannot access configuration files.

Noko
--
"Careful with that VAX, Eugene!"
.



Relevant Pages

  • Re: How to resolve names
    ... So I can ping and try to ssh/telnet the 2 other machines from my PC via ... I cannot do it by using their host names although I get proper ... # entry should stop if the search in the previous entry turned ... # passwd: files nis ...
    (comp.os.linux.networking)
  • Re: Resolving .local domain FQDN on client
    ... Take a look at the man page of host.conf and specially at the option mdns. ... with the tool 'host' I can resolve queries just fine. ... I get the correct answer and a request to the DNS server is made as I can ... $ ping svn.domain.local ...
    (Debian-User)
  • Re: ping me comes back 127.0.0.1
    ... What host is providing the DCHP service to assign you an IP address? ... A DHCP server in a router? ... When you say you cannot ping by name, do you mean a hostname, like "elmer", ... That's the DNS server. ...
    (microsoft.public.win2000.networking)
  • Re: strange delay while dns resolve
    ... > If I ping my router or a ip out in the internet, ... I didn't use the dns server but pinged using the ip. ... > The ping times stay the same but between each ping is a 2 second delay, ... > think it is the time where the host name is resolved to its ip. ...
    (comp.os.linux.networking)
  • Re: DNS and name resolution issues
    ... I forgot to add that I can ping if I use the FQDN of the host I am trying to ... can I resolve the name to an IP address using NSLOOKUP. ... NSLOOKUP and point it to the DNS server on 10.4.x.x and I get the results ...
    (microsoft.public.windows.server.dns)