Thứ Bảy, 28 tháng 2, 2009

[OpenSolaris] DNS & Routing not work

In OpenSolaris, sometimes DHCP can work properly and you can obtain an IP. However, there are some cases when you can't access Internet because of DNS problem.

To resolve DNS problem in OpenSolaris, follow these instruction:

 $cp /etc/nsswitch.dns /etc/nsswitch.conf 
Check if the DNS client is already running
$svcs -a | grep dns 
and see this result
online   14:17:45 svc:/network/dns/client:default
If the result doesn't look like this one, you can restart NWAM and then see the result:
      $pfexec svcadm restart network/physical:nwam

Because the DNS client uses "/etc/resolv.conf" to find the "nameserver". Therefore, run
$pfexec vi /etc/resolv.conf
make sure I had this entry in there.
nameserver 192.168.1.1
where 192.168.1.2 is your DNS server IP.


****After those instructions, try a ping ($ping www.google.com) to see if you can access Internet or not ?

$ ping www.google.com

When you see:

www.google.com is alive

It means that now you can surf web ^^

There are some cases when you can still not access Internet and you will see this after a ping

ICMP Host Unreachable from gateway 192.168.1.3
for icmp from 192.168.1.3 to tx-in-f147.google.com (72.14.203.147)
ICMP Host Unreachable from gateway 192.168.1.3
.....

Don't worry, just do as follow to resolve default gateway problem :

- Open file /etc/defaultrouter and then check if there is a default gateway IP in this file. If there is not, manually add your default gateway (usually 192.168.1.1).

- Run the following command
     $pfexec svcadm restart network/routing-setup
Then, enjoy your life with OpenSolaris.

***
Those entry was solved under help of many Sun Microsystems staffs and reference in this article.

1 nhận xét:

  1. I installed OpenSolaris and can not access internet. I did as you said in this post. But when I executed the command "$svcs -a | grep dns " I got this result:
    disabled 18:48:24 svc:/network/dns/server:default
    online 18:49:11 svc:/network/dns/multicast:default
    online 18:53:02 svc:/network/dns/client:default

    I continue executing the command:
    $pfexec svcadm restart network/physical:nwam
    and command:
    $pfexec vi /etc/resolv.conf
    and typed in the text: nameserver: 192.168.1.1 (it is my DNS).
    and then I excecuted this command:
    ping www.google.com as you said and I got this result:
    ping: unknown host www.google.com.
    moreever I did't get the text:
    ICMP Host Unreachable from gateway 192.168.1.3
    for icmp from 192.168.1.3 to tx-in-f147.google.com (72.14.203.147)
    ICMP Host Unreachable from gateway 192.168.1.3

    as you said.
    please show me what problem is and how to fix it. I'm Pyraman and from HUT.

    Trả lờiXóa