Archive

Posts Tagged ‘DNS’

OpenSolaris DNS resolving problem when using static IP

November 28, 2009 4 comments

As the title above, this is my first time using OpenSolaris, i’ve a little problem when using this operating system, If you tried to setup a manual IP on your opensolaris box you may find that DNS is not working as you would expect in some cases. nslookup resolves the name to an ip, but pinging doesn’t make it to the box…

Note: in this solution makes sure you have fill the DNS in the GUI mode, System > Administration > Network > DNS

and make sure file /etc/resolv.conf contain the same DNS as you fill in the GUI mode

This is exactly my problems :

Successfully Resolving DNS

hans@dXBase:/etc$ nslookup http://www.yahoo.com
Server:        202.138.224.2
Address:    202.138.224.2#53

Non-authoritative answer:
http://www.yahoo.com    canonical name = http://www.wa1.b.yahoo.com.
http://www.wa1.b.yahoo.com    canonical name = www-real.wa1.b.yahoo.com.
Name:    www-real.wa1.b.yahoo.com
Address: 209.131.36.158

Pinging IP address successfully

hans@dXBase:/etc$ ping 209.131.36.158
209.131.36.158 is alive

BUT failed to ping hostname

hans@dXBase:/etc$ ping -l http://www.yahoo.com
ping: unknown host http://www.yahoo.com

How to fix it….??

Open your terminal and switch to root user, then edit your /etc/nsswitch.conf file and add the word “dns to the hosts and ipnodes lines

This is my nsswitch.conf file snippet:

passwd:     files
group:      files
hosts:      dns
ipnodes:    dns

networks:   files
protocols:  files
rpc:        files

There is default backup of /etc/nsswitch.conf file you can also just copy /etc/nsswitch.dns over it…

hans@dXBase:/# cp /etc/nsswitch.dns /etc/nsswitch.conf

You may also want to check that auto-magic mode has been disabled when setting up your networking manually;

hans@dXBase:/# svcs -a | grep nwam

If it is enabled type;

hans@dXBase:/# svcadm disable svc:/network/physical:nwam

And…. ROLL Drum please…………. 🙂

hans@dXBase:/# ping http://www.yahoo.com
http://www.yahoo.com is alive

Advertisements