Thursday, March 19, 2009

HOW TO SETUP DNS

  • Get the bind (or often called named) package installed on your distribution
  • Make sure you are root
  • Locate named.conf (could be in /etc or /etc/bind or /etc/named)
  • Edit that file according to your needs. Here are some things that you need in there:
    options {
    ...
    forward first;
    forwarders {
    {THE_IP_ADDRESS_OF_YOUR_UPSTREAM_DNS_SERVER;} ;
    };
    ...
    };
    ...

    zone "open-ims.test" IN {
    type master;
    file "pri/open-ims.dnszone";
    notify no;
    };
    ...

    On some distributions this file includes other files so be sure to dig through those also.
    THE_IP_ADDRESS_OF_YOUR_UPSTREAM_DNS_SERVER can be found in /etc/resolv.conf.

  • Now copy the file /opt/OpenIMSCore/ser_ims/cfg/open-ims.dnszone to where you configure it above
    (pri/open-ims.dnszone)
    cp /opt/OpenIMSCore/ser_ims/cfg/open-ims.dnszone /var/bind/pri/
    chown -R named:named /var/bind/pri/open-ims.dnszone
  • Then start or re-start the DNS server (remember that these configuration files are not monitored
    for changes so you will have to send a SIGHUP or do a restart to reload them).
    /etc/init.d/named restart
  • You should now test if it works. In the response look if you got the correct answer.
    dig @127.0.0.1 pcscf.open-ims.test
  • To actually use it, you would need to configure it as a DNS server for your machine. Here is
    how your /etc/resolv.conf file should look like:
    # cat /etc/resolv.conf
    nameserver 127.0.0.1
    search open-ims.test
    domain open-ims.test
  • Remember that utilities like the DHCP-Client overwrite this file be default!

No comments: