Tuesday, March 26, 2013

OpenSolaris issue DNS not working solved


I manually configured Open Solaris(2009 edition),however the DNS is not working,here how it worked out for me

Nslookup resolves the name to an ip, but pinging doesn’t make it to the box…


Static IP address

Assigning a static IP address on OpenSolaris is accomplished by editing the hostname files in the directory /etc. For example, assign a static IP address to interface bge0 by editing /etc/hostname.bge0:

192.168.0.123

Set the netmask by editing the file /etc/inet/netmasks:

192.168.0.0 255.255.255.0

Set the default gateway by editing the file /etc/defaultrouter:

192.168.0.1

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

 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

 ping 209.131.36.158
209.131.36.158 is alive

BUT failed to ping hostname

 ping -l http://www.yahoo.com
ping: unknown host http://www.yahoo.com

So the fix is

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…

 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;

svcs -a | grep nwam

If it is enabled type;

svcadm disable svc:/network/physical:nwam

And you are done!!!


source:http://dxzstudioz.wordpress.com/2009/11/28/opensolaris-dns-resolving-problem-when-using-static-ip/

source: http://www.jansipke.nl/network-configuration-on-opensolaris/

No comments:

Post a Comment