MoonPoint Support Logo

 


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



Advanced Search
August
Sun Mon Tue Wed Thu Fri Sat
     
17
 
2007
Months
Aug


Fri, Aug 17, 2007 9:43 pm

DNS Server Listening on All Addresses

I removed the line listen-on { 127.0.0.1; }; from /etc/named.conf to enable a Solaris server to listen on all IP addresses for the server, not just the loopback address, making it usable as a DNS server by other systems on the LAN.

[/os/unix/solaris] permanent link

Fri, Aug 17, 2007 9:23 pm

Start Named Service under Solaris

I had configured a Solaris 10 system to function as a name server (see Configuring a Solaris System as a DNS Server), but when I rebooted the system it was no longer functioning as a DNS server and since the only name server I had listed in /etc/resolv.conf was the system itself, i.e. its loopback address, I could not resolve system names to IP addresses.

# svcs | grep 'named'
# nslookup cisco.com
;; connection timed out; no servers could be reached

# cat /etc/resolv.conf
domain example.com
nameserver 127.0.0.1

I could run named to start the named daemon again, so that I could resolve names, but I wanted it to start automatically when the system boots. To do so, I created the file /etc/init.d/named with the following lines in the file:

#!/sbin/sh
#
# named
#

case "$1" in
  start)
        # Start daemon.
        echo "Starting named"
        /usr/sbin/named
        ;;
   stop)
       # Stop daemon.
       echo "Shutting down named"
       pkill named
       ;;
*)
        echo "Usage: $0 { start | stop }"
        exit 1
        ;;
esac

exit 0

I then changed the group ownership for the file to sys to make it consistent with the other files in that directory and made it executable.

# chgrp sys /etc/init.d/named
# chmod 744 /etc/init.d/named
# ls -l /etc/init.d/named
-rwxr--r--   1 root     sys          284 Aug 17 20:07 /etc/init.d/named

To have it start automatically, I also needed to add it to /etc/init.d/rc3.d. You need to prefix the name with "S" and then a number to have it start automatically. You will see other files with names beginning with Sxx where "xx" is some number. You must pick a number that is different from any already used. I picked the next higher number, 91, in this case.

# cp -p /etc/init.d/named /etc/rc3.d/S91named

When you reboot, you can check that the service is running with the ps or svcs commands or do an nslookup .

# ps -ef | grep named
    root   537     1   0 20:42:16 ?           0:00 /usr/sbin/named
# svcs | grep named
legacy_run     20:42:18 lrc:/etc/rc3_d/S91named
# nslookup cisco.com
Server:         127.0.0.1
Address:        127.0.0.1#53

Non-authoritative answer:
Name:   cisco.com
Address: 198.133.219.25

References:

  1. Configuring a Solaris System as a DNS Server
    MoonPoint Support
  2. Building and configuring BIND 9 in a chroot jail
    By Steve Friedl
    Unixwiz.net - Software Consulting Central

[/os/unix/solaris] permanent link

Once You Know, You Newegg AliExpress by Alibaba.com

Shop Amazon Local - Subscribe to Deals in Your Neighborhood

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo