Problems with accessing Internet through router (permanent IP)
Hi.
I changed hostname with sys-unconfig. Now computer has permanent IP address (non DHCP) and right hostname.
Before this change I had access to Internet (hostname: "unknown" and DHCP).
My computers access Internet through router.
There is ping from my computer to router and another computer. Also other computer pings my computer.
In DHCP tables my computer does not exist.
I created file /etc/defaultrouter with IP of my router.
Trying to access Internet, web browser (Mozilla) writes: "<site.com> could not be found. Please check name and try afain."
I think there is a problem with DNS.
How to configure my computer on Solaris 10 to access the Internet with current configuration?
Thank you.
# 1
Create empty file
/etc/hostname.le0
(le0 being the network interface, change to whatever ifconfig says)
Create empty file
/etc/dhcp.le0
Create file
/etc/nodename
containing the hostname you want ended with a carriage return
You may want to remove 12 from the PARAM_REQUEST_LIST line in /etc/default/dhcpagent
to tell the dhcp client not to ask for hostname from dhcp server.
I believe you can remove the /etc/defaultrouter
reboot
Martin
# 2
To test DNS services without a browser (ie, to see if the
system can be a DNS client), first use the command
'nslookup'
#/usr/sbin/nslookup sun.com
Server: miki-class-gla.eclecticgroup.co.uk
Address: 10.23.0.1
Non-authoritative answer:
Name:sun.com
Address: 72.5.124.61
# /usr/sbin/nslookup google.com
Server: miki-class-gla.eclecticgroup.co.uk
Address: 10.23.0.1
Non-authoritative answer:
Name:google.com
Addresses: 64.233.167.99, 64.233.187.99, 72.14.207.99
If this doesn't work, then your system isn't talking to a
DNS server at all at all, so you need to check the contents
of /etc/resolv.conf.
If it does work, use the command 'getent' to check that your
system as a whole is querying DNS for name-IP resolution.
EG.
# getent hosts sun.com
72.5.124.61sun.com
# getent hosts google.com
64.233.187.99google.com
72.14.207.99google.com
64.233.167.99google.com
If you don't get back IP addresses, your system isn't
correctly configured as a DNS client.
Look at /etc/nsswitch.conf, and find the line
that starts 'hosts'.
If it says
hosts files
then the system is not a DNS client.
To correct this, edit that line to add the word dns on the end:
hosts files dns
That's it. No need to reboot.
# 3
I didn't find the file:/etc/resolv.conf.
Also, I edited file: /etc/nsswitch.conf:
hosts: files dns
That didn't work. nslookup gave the same result:
"; ; connection timed out; no servers could be reached"
I tryed to reboot with and without /etc/defaultrouter, but all is the same.
Maybe there is some way to specify IP address of router as Gateway (like is done on Windows)?
# 4
> I didn't find the file:/etc/resolv.conf.
> Also, I edited file: /etc/nsswitch.conf:
> hosts: files dns
You need to have BOTH files with the right information.
/etc/resolv.conf needs to have the ip address of the name server
and /etc/nsswitch.conf is what tells Solaris to read /etc/resolv.conf.
You need both of them.
> Maybe there is some way to specify IP address of
> router as Gateway (like is done on Windows)?
yes, add it to /etc/defaultrouter.
alan
# 5
I didn't find the file /etc/resolv.conf.Can I create it and just put IP address (like /etc/defaultrouter) of name server?Thanks.
# 6
I created the file: /etc/resolv.conf and put there nameserver X.X.X.X
(X.X.X.X indicates my router IP that provides DNS service).
nslookup works, gives IP addresses of internet sites.
Still can't access WEB. For example, Mozilla writes: "Resolving address www.google.com" -or something like that.
ping writes: "unknown host www.google.com".
Maybe in file: /etc/nsswitch.conf I should write:
"hosts files dns"
and not "hosts: files dns"?
# 7
I Found what I missed:in file: /etc/resolv.confdomain domain_namenameserver dns_server_ipIt works perfectly. :-)Thank you all very much.