MoonPoint Support Logo


Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals

Advanced Search
Sun Mon Tue Wed Thu Fri Sat

Wed, Jun 22, 2005 4:39 pm

Configuring a Solaris System as a DNS Server

A script to configure a Solaris system as a DNS server is available at After downloading the script make it executable with chmod, e.g. chmod 755 When you run the script, /etc/resolv.conf and either /etc/named.boot or /etc/named.conf will be replaced, so you may want to make a backup copy of those files beforehand. The output of the script, which should be run from the root account, is shown below:

# sh
This script will automatically configure your machine to run a
DNS server. It will completely destroy /etc/resolv.conf, and
either /etc/named.boot, or /etc/named.conf, as appropriate
It may also modify /etc/nsswitch.conf if neccessary.
Continue? (y/n)
copied /etc/resolv.conf to /etc/resolv.conf.pre-config
Made /etc/resolv.conf
nsswitch.conf already okay
Restarting namedemon
cat: cannot open /etc/
As soon as your internet link is up, you should be set to go!
Please note: This script assumes you are setting up a single isolated
machine. If this machine needs to allow others to query DNS through it,
please read the comments in /etc/named.conf

The /etc/named.conf file produced by the script is shown below:

options {
                directory "/etc/named";
# use if you are an isolated machine. Otherwise, either
# comment out the "listen-on" line entirely, or supply the appropriate
# internal or external address
                listen-on {; };
        zone "." in {
                type hint;
                file "named.cache";

        zone "" in {
                type master;
                file "named.local";

The "listen-on" line, by default, will have the system listen for name queries only on the loopback port,, which means that you could perform host lookups only on the system itself. You could use the nslookup command to verify that the system is responding to name queries as below:

# nslookup
Default Server:  localhost

Server:  localhost


But, if you configure another system to use the Solaris system as a DNS server, it won't respond, since it is only listening on the local loopback port. If the Solaris system has an IP address of, you could replace the listen-on line in /etc/named.conf with listen-on {;; }; or comment out or remove the listen-on line to have the system respond to queries on any network interface. If you change /etc/named.conf, you will need to restart the name server, which you can do with the commands below:

kill `cat /etc/` 2>/dev/null

If you create a script to restart the name server, put a sleep 1 between the two lines above.

The /etc/resolv.conf file that you will have when you run the installation script will look something like the one below:


I've used the script on a Solaris 2.7 system. Other Solaris scripts are available from the creator of the script, Philip Brown, at Phil's Solaris Hints or mirrored at Phil's Solaris hints.

Download Script
Bolthole MoonPoint Phil's Solaris Mirror Site

[/os/unix/solaris] permanent link

Once You Know, You Newegg AliExpress by

Shop Amazon Local - Subscribe to Deals in Your Neighborhood

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo