Configure DNS

I am running Solaris 2.6 Server on a Sparc 10 and I was wondering how I can manually specify a DNS server to resolve hostnames. Any help will be greatly appreciated.
And also I have created a file in the /etc dir named defaultrouter and added th IP address of my router, but when I ping another computer on a seperate network it replies with something like "network unreachable from gateway X.X.X.X " where "X.X.X.X" is the IP address of my Unix machine...not the router. I was wondering if there is a command that will allow me to view all of my network settings such as IP Address, Default Gatway, DNS Servers, etc....

Put a line in /etc/resolv.conf like this:

nameserver X.X.X.X

(put in your nameserver's IP address instead of X's)

You may specify more than one "nameserver" line in the resolv.conf file.

You might have to restart networking to get your /etc/defaultrouter file read in. Alternately, use the "route" command to add a default gateway. Something like:

route add default gw X.X.X.X

"netstat -r" will show your routes. "ifconfig" will show your IP address.

[Edited by PxT on 05-07-2001 at 11:02 AM]

I created the resolv.conf file in the /etc/ directory and added the line:
nameserver x.x.x.x

but I still cannot get any name resolution. I can access public websites via IP address, but not hostname.....weird!

Did you add the name of your local hostname to the /etc/hosts file?

You did replace the x's with the IP address of your nameserver, right? The line should look something like:

nameserver 192.168.0.1

replace the IP with that of your DNS server.

You also need the name of your domain in the resolv.conf file:

domain     yourdomain.com

my resolv.conf look's like this:

nameserver 10.10.10.1

my host file looks like this:

10.10.10.1 nameserver

This computer is not part of a domain.

To use DNS you must be a part of a domain. This is not the same a microsoft domain, BTW. DNS is the 'domain names system' and requires fully qualified domain names to work. Resolver will append the name of the domain to each query, etc. Nameservers must be running named. Are you running named? If so, what is your named.conf file (must have domain records)?

I am using my firewall to NAT one IP address for three computers on one network. Sort of like a proxy server. My Solaris box is one of these computers. So are you suggesting that I configure my Solaris box to use the domain information that my firewall is using on it's external interface. I am running a rather home made network. I am using ATT @Home and I purchased three public IP address from them. I am running a Check Point firewall on NT Server 4.0 with 3 NICs installed. On one of the NICs I have it configured with the @home configuration they supplied. The other two NICs I have configured as my internal network (Hiding behind 1 Public IP address, My Solaris box, and two other NT servers) and the other NIC on my firewall is configured as my DMZ network.

Are you recommending that I add the DNS suffix of the @home DNS servers in my resolv.conf file.

plstn.sfab.home.com is the domain I was given and it is what my firewall is configured to use.

I think your firewall can act as a nameserver as well (name record caching).
Why don't you see if that is possible and point your Solaris box to the IP/hostname of your firewall for Name resolution?
Since you're NAT'ing the IPs you'd prbly have to use the internal IP address that your Boxes use to connect to the Firewall with.
HTH.

Here is what my network looks like:

        Internet
            |
        Firewall-1
        |        |
   ---------  \-------

DMZ -| | | |- Internal Network
WEB FTP SUN NT

All of my servers can get out to the internet just fine. Only my WIndows servers can use DNS successfully.
My Solaris 2.6 Server cannot use DNS...probablly because I don't understand exactly how to configure it correctly.

On my Firewall, the DNS configuration look like this:
Domain:plstn.sfba.home.com
Server:20.1.90.32
20.1.90.31

My NT servers are configured the same way.

My Solaris server is configured as follows:

resolv.conf
------------
domain plstn.sfba.home.com

nameserver 20.1.90.32
nameserver 20.1.90.31

hosts
---------
20.1.90.32 dns1
20.1.90.31 dns2

I cannot use host names to access websites...only IP addresses. In my resolv.conf file, Do I use the phsical name "nameserver" or do I replace that with the name configured in my hosts file (dns1)? I am having no luck here at all......

my diagram didn't exactly turnout the way it should have

Internet--->Firewall---->SUN PC

Make sure that your nameserver IP is the same. try and see if it works. Because solaris don't work like windows u know. I myself have face the type of problem in the past
nameserver 20.1.90.32
nameserver 20.1.90.32

What happens if you do:
$dig @20.1.90.32 www.unix.com

Doeas this also apply to Linux distributions such as Fedora , I'd like to know this because I want to use the opendns servers instead of my ISPS dns servers?

Yes all *NIX based resolvers (as far as a i know all OS resolvers) prefer 2 nameserver entries. You may however have more.