The Linux Administration group is for the discussion of technical issues technical issues that arise during the administration of Linux systems, including maintaining the operating system and supporting end-user applications.

nslookup error

Hi dears.
I have connected two system as windows as client and redhat as server and run dns between them for dns.
When i ping server by its name dns conver hostname to ip address but when i use nslookup in cmd of windows no reply reciever from server.
any help please.

Strange (so far :) ... you can ping the FQDN OK but nslookup does not resolve ...

Does the WinX client have the same DNS server in it's config (ie default appears OK but nslookup configured to use another DNS server ? After you enter, "nslookup", it will display the default server).

Hi steve,
I choose dns server ip in tcp/ip config of Windows client.
So when I ping the server by its hostname, client distinguish its server and send packet to it and receive the ip.
But when I use nslookup no hostname is found and no resolve.
If my dns has problem why hostname is resolving to ip address by dns?

Do you have an entry for domain in your hosts file? You can find this in:

C:\WINDOWS\system32\drivers\etc\hosts

nslookup always uses DNS whereas ping uses other methods for finding
hostname as well.
=====================
=====================
1. Is your DNS server working for local only or you are using your DNS
as chache DNS server also?

I'm curious as to why ping would use the local hosts file and not DNS. It seems more likely that he is not using the FDQN (DNS recognized) name of his server on both queries, explaining why it works on ping and not on nslookup. His Linux server is very likely a SMB server as well.

Have you set up the reverse dns db file with the correct naming? For example: the dns has a database file db.names: SystemName IN A 192.168.9.200 there should also be a reverse dns database file, db.192.168.9.0 that contains pointer records SystemName PTR 192.168.9.200.

Hi people.
Thanks for all replies.
I check two notes.
1. When I use nslookup in my client, this is the result:
Unknown hostname.
ip 192.80.80.1
2. In my Linux server terminal when I use nslookup hostname.mydomain-name it shows:
cannot find server.
I can't distinguish the difference of nslookup and ping that one can get ip of hostname but another can't do it?

When I use nslookup in my client, this is the result:
Unknown hostname.
ip 192.80.80.1

That is not what the result it at all. Please stop wasting everyone's time. Please take the time to post what it actually returns instead of paraphrasing. nslookup will return data in the following format.

This file indicates what nameserver(s) to use for host look ups. Also check
/etc/nsswitch.tab, I believe that is the name. Try using the 'dig' command
instead of nslookup on Linux, I believe nslookup has been deprecated on
Linux.

*/etc/nsswitch.conf* is the file in unix systems to configure everything
related to naming and resolving, not only DNS but other
stuff (services, protocols, etc), the line for name resolution is this one:

hosts: files dns [NOTFOUND=return] mdns4

that's the search order when trying to resolve a name: first search
into /etc/hosts (file) then ask the DNS, as stated in
*/etc/resolv.conf * which is the file where the local DNS configuration,
i.e, nameservers, domain search list, etc. is placed.