Sponsored Content
Special Forums IP Networking DNS problem : ping doesn't recognize hostname Post 302985265 by MadeInGermany on Monday 7th of November 2016 05:04:48 PM
Old 11-07-2016
Quote:
Originally Posted by evanbooyens
Remember that ping often uses gethostbyname system/kernel call where traceroute often uses the actual DNS lookup. You can also easily test whether the entries are indeed in DNS by using nslookup or dig
Yes, ping (and traceroute) use gethostbyname() for resolving hostnames. And gethostbyname() goes to /etc/nsswitch.conf that must have the line
Code:
hosts: files dns

to consider first /etc/hosts then DNS.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Doesn't recognize the mv command

I'm nearly finished my program i've got everything in place and than when i run it it comes back with the reply mv: command not found. This is the code that seems to be causing the problem. elif then echo "There are more than one '$1' files in the system." echo "Please... (2 Replies)
Discussion started by: zoolz
2 Replies

2. HP-UX

UX 11iV2 - No ping by hostname

Hi. I just installed the HP-UX 11i V2. I have problems with CDE - it is inoperative (after logon there is a message box: messaging system failure - or something like that, it asks to check /etc/hosts and network settings). nslookup works by hostname and IP, hostname shown the correct... (7 Replies)
Discussion started by: netwalker
7 Replies

3. HP-UX

HP-UX 11.11: X doesn't recognize mouse and keyboard

hi folks, i've got a blank hp visualize C3000 workstation and installed HP-UX 11.11. When I want to start X, I get the following error message: # X Fatal server error: Couldn't open X pointer device! Is one attached? I've connected an mouse and a keyboard with an usb/ps2 connector.... (5 Replies)
Discussion started by: grisu
5 Replies

4. Solaris

cannot ping by hostname

Hi All, My current setup is: 1x Windows Server (Windows 2000 server) 1x Unix Server 2x Windows machine 3x Unix Terminals (Hostnames = A, B and C) Problem The problem iam having is Unix terminal C cannot be ping across by Unix terminal A or B or Unix server by using the hostname. Unix... (1 Reply)
Discussion started by: tlee
1 Replies

5. Solaris

Can't ping using hostname on Solaris 10

I recently installed Solaris 10 on my Sun workstation. I cannot ping using hostname from another computer on the same network. But I can ping using the IP address. Also I can ping other systems using their hostnames. Can anyone give some information regarding how to resolve this issue. (4 Replies)
Discussion started by: alpha123
4 Replies

6. AIX

Ping by hostname

Hello everyone I have a partition with a problem with ping. If I do a ping by ip for example ping 1.1.1.1 I got no problem but If I ping by hostname for example ping partition1 take almost a minute to respond me. I have Aix 5.3 and I have another 19 partitions with no problem. The only... (5 Replies)
Discussion started by: lo-lp-kl
5 Replies

7. UNIX for Advanced & Expert Users

ping by hostname not working

anyone ever seen this problem: I can ping the server by IP address but I can't by hostname. nslookup is working and dns query is ok. # nslookup mwxnsb24 Server: 10.11.49.206 Address: 10.11.49.206#53 Name: mwxnsb24 Address: 10.10.58.175 # ping... (8 Replies)
Discussion started by: linuxgeek
8 Replies

8. Shell Programming and Scripting

Expect doesn't recognize a password prompt

Hi. Here is beginning of my script #!/usr/local/bin/expect -- set timeout 15 spawn /usr/local/account.sh -n modify expect "Password:" {send "mypassword\r"} But due to some terminal control sequences (or something else, dunno exactly) my password prompt is looking like this: and expect... (3 Replies)
Discussion started by: urello
3 Replies

9. Shell Programming and Scripting

Value of variable is NULL, but test doesn't seem to recognize

Hello, Unix-forums! My problem: read -p "Enter any number, please" number sleep 1 echo $number | tr -d 0-9 test -z $number && echo "Thank you" || echo "This is not a number"Test always displays "This is not a number". It doesn't matter if I entered a or 1. But if I order echo... (2 Replies)
Discussion started by: intelinside
2 Replies
NSSWITCH.CONF(5)					      BSD File Formats Manual						  NSSWITCH.CONF(5)

NAME
nsswitch.conf -- name-service switch configuration file DESCRIPTION
The nsswitch.conf file specifies how the nsdispatch(3) (name-service switch dispatcher) routines in the C library should operate. The configuration file controls how a process looks up various databases containing information regarding hosts, users (passwords), groups, netgroups, etc. Each database comes from a source (such as local files, DNS, and NIS), and the order to look up the sources is specified in nsswitch.conf. Each entry in nsswitch.conf consists of a database name, and a space separated list of sources. Each source can have an optional trailing criterion that determines whether the next listed source is used, or the search terminates at the current source. Each criterion consists of one or more status codes, and actions to take if that status code occurs. Sources The following sources are implemented: Source Description files Local files, such as /etc/hosts, and /etc/passwd. dns Internet Domain Name System. ``hosts'' and ``networks'' use IN class entries, all other databases use HS class (Hes- iod) entries. mdnsd Use mdnsd(8) for ``hosts'' lookups, acting as both a system-wide cache for normal unicast DNS as well as providing multicast DNS (``zeroconf'') lookups. multicast_dns Use mdnsd(8) only for multicast DNS ``hosts'' lookups. This would normally be used in conjunction with ``dns'', which would then provide unicast DNS resolver functions. nis NIS (formerly YP) compat support '+/-' in the ``passwd'' and ``group'' databases. If this is present, it must be the only source for that entry. Databases The following databases are used by the following C library functions: Database Used by group getgrent(3) hosts gethostbyname(3) netgroup getnetgrent(3) networks getnetbyname(3) passwd getpwent(3) shells getusershell(3) Status codes The following status codes are available: Status Description success The requested entry was found. notfound The entry is not present at this source. tryagain The source is busy, and may respond to retries. unavail The source is not responding, or entry is corrupt. Actions For each of the status codes, one of two actions is possible: Action Description continue Try the next source return Return with the current result Format of file A BNF description of the syntax of nsswitch.conf is: <entry> ::= <database> ":" [<source> [<criteria>]]* <criteria> ::= "[" <criterion>+ "]" <criterion> ::= <status> "=" <action> <status> ::= "success" | "notfound" | "unavail" | "tryagain" <action> ::= "return" | "continue" Each entry starts on a new line in the file. A '#' delimits a comment to end of line. Blank lines are ignored. A '' at the end of a line escapes the newline, and causes the next line to be a continuation of the current line. All entries are case-insensitive. The default criteria is to return on ``success'', and continue on anything else (i.e, [success=return notfound=continue unavail=continue tryagain=continue] ). Compat mode: +/- syntax In historical multi-source implementations, the '+' and '-' characters are used to specify the importing of user password and group informa- tion from NIS. Although nsswitch.conf provides alternative methods of accessing distributed sources such as NIS, specifying a sole source of ``compat'' will provide the historical behaviour. An alternative source for the information accessed via '+/-' can be used by specifying ``passwd_compat: source''. ``source'' in this case can be 'dns', 'nis', or any other source except for 'files' and 'compat'. Notes Historically, many of the databases had enumeration functions, often of the form getXXXent(). These made sense when the databases were in local files, but don't make sense or have lesser relevance when there are possibly multiple sources, each of an unknown size. The interfaces are still provided for compatibility, but the source may not be able to provide complete entries, or duplicate entries may be retrieved if multiple sources that contain similar information are specified. To ensure compatibility with previous and current implementations, the ``compat'' source must appear alone for a given database. Default source lists If, for any reason, nsswitch.conf doesn't exist, or it has missing or corrupt entries, nsdispatch(3) will default to an entry of ``files'' for the requested database. Exceptions are: Database Default source list group compat group_compat nis hosts files dns netgroup files [notfound=return] nis passwd compat passwd_compat nis FILES
/etc/nsswitch.conf The file nsswitch.conf resides in /etc. EXAMPLES
To lookup hosts in /etc/hosts and then from the DNS, and lookup user information from NIS then files, use: hosts: files dns passwd: nis [notfound=return] files group: nis [notfound=return] files The criteria ``[notfound=return]'' sets a policy of "if the user is notfound in nis, don't try files." This treats nis as the authoritative source of information, except when the server is down. SEE ALSO
getent(1), nsdispatch(3), resolv.conf(5), named(8), ypbind(8) HISTORY
The nsswitch.conf file format first appeared in NetBSD 1.4. AUTHORS
Luke Mewburn <lukem@NetBSD.org> wrote this freely distributable name-service switch implementation, using ideas from the ULTRIX svc.conf(5) and Solaris nsswitch.conf(4) manual pages. BSD
October 25, 2009 BSD
All times are GMT -4. The time now is 01:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy