Solaris 10 DNS Server for LAN
I finally got a DNS server up and running for my computers. Thanks to http://www.logiqwest.com/dataCenter/Demos/RunBooks/DNS/DNSsetup.html
with a great little script that turns your hosts file into DNS entries for BIND.
Basically it came down to:
Editing the /etc/hosts file to have all the records I wanted
Create /var/named directory
Place the h2n script in the /var/named directory
Execute the script with the following options:
./h2n -d mydomain.home -n 192.168.1 -u email@mydomain.home
Edit the resulting db.mydomain file to contain a CNAME to work nicely with my apache config
* CNAME sunfire
Download the named.root file from ftp://ftp.rs.internic.net/
Copy it into the /var/named directory and change the name to db.cache
cp named.conf /etc
Make sure /etc/nsswitch.conf has the following line:
hosts: files dns
Create or Edit /etc/defaultdomain to contain the domain name, ie, “mydomain.home”
Set the domain name
# domainname `cat /etc/defaultdomain`
Edit /etc/resolv.conf to contain:
# these entries should be after the real world nameserver entries
domain mydomain.home # the domain just made
nameserver 192.168.1.110 # the IP of the DNS server
Check if the DNS server is running:
svcs -a | grep dns
If it isn’t, start it with:
svcadm enable /network/dns/server
Then start the named service:
/usr/sbin/in.named &
“To use DNS, clients need to modify the /etc/resolv.conf, and /etc/nsswitch.conf as above. The /etc/defaultdomain file must also be created and establsihed as above.”
I was able to use the DNS server I just made from a linux PC by just adding the IP of the new DNS server to my /etc/resolv.conf file
