Link to home
Start Free TrialLog in
Avatar of sharone_
sharone_

asked on

can't telnet to machines by name

(solaris2.7)
I try to telnet a computer somewhere in the world. when I use it's name it says unknown host but when I use it's IP it connect OK.
when I use nslookup it finds both name and IP.
What's missing.
ASKER CERTIFIED SOLUTION
Avatar of kawin
kawin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sharone,
     I'm not sure about kawin answer above because I've never tried only the /etc/nsswitch.conf.  Maybe it might work.  If it does not, you can try my option.  Too bad, the question is locked, and I have to post it as a comment only.  Anyway, back to the main point.

    The file that you will be interested to look at will be:

        /etc/resolv.conf
 
    This file might not  be around when you first installed the Solaris 7.  You need to create it. Perhaps, do a vi /etc/resolv.conf will do.  The file should contains:

domain and-your-domain-name      
nameserver your-isp-dns-server
nameserver your-second-dns-server


/etc/nsswitch.conf

    Look for the line hosts: files

    Modify it to
   hosts: files dns

   The order, does matter, files followed by dns will cause namelookup to look for any matching entry in /etc/hosts and if it's not there, then query the first nameserver in the /etc/resolv.conf.  If the 1st nameserver fails, then query the 2nd.  On the other hand, putting dns followed by files will do the opposite.  remember though, some software, I believe sendmail, will only query the DNS for resolution of MX entries (oopps... that's another story :(

  REMEMBER, if you plan to use you Solaris as stand alone, or in private environment, you can either setup a DNS server (or use in available in your private network), or hardcoded each and every IP address -> hostname in your /etc/hosts file.  :(  It's kinda of tedious, but in some cases, does speed up things a lot.  The only drawback is that, everytime, new machine is installed, or modification to the IP->host mapping, you need to revisit this file to make changes.

I hope this should help (and clears you confusion).

Regards,

Samri
Avatar of wallstreetx
wallstreetx

I guess /etc/resolv.conf has been replaced by /etc/defaultrouter in 2.6 & higher.
If you try to add resolv.conf, it might not even allow you to ping by IP