How to setup GnuDIP on Ubuntu Edgy

GnuDIP is an open source dynamic DNS solution for all of us who want to provide dynamic domain name to customers, e.g., ISP may provide a free dynamic domain regarding to the user name. I will just give an instruction that I used to setup a GnuDIP service on Ubuntu Edgy.

Follows my procedures below.

  1. Install GnuDIP

    sudo apt-get install gnudip
    
  2. Install bind and mysql

    sudo apt-get install bind9 mysql-server
    
  3. Create a new database called gnudip2 and also a user with full privilege

    mysql_setperssion -uroot
    
  4. Execute below SQL script to initialize database

    # MySQL dump 6.0
    #
    # Host: localhost    Database: gnudip2
    #--------------------------------------------------------
    # Server version        3.22.25
    
    #
    # Table structure for table 'domains'
    #
    CREATE TABLE domains (
      id int(10) NOT NULL auto_increment,
      domain varchar(50),
      zonefile varchar(255),
      zonetype varchar(10),
      changepass varchar(5),
      addself varchar(5),
      PRIMARY KEY (id)
    );
    
    #
    # Dumping data for table 'domains'
    #
    
    
    #
    # Table structure for table 'globalprefs'
    #
    CREATE TABLE globalprefs (
      id int(10) NOT NULL auto_increment,
      param varchar(30),
      value varchar(255),
      PRIMARY KEY (id)
    );
    
    #
    # Dumping data for table 'globalprefs'
    #
    
    INSERT INTO globalprefs VALUES (1,'ALLOW_CHANGE_PASS','YES');
    INSERT INTO globalprefs VALUES (2,'ADD_SELF','YES');
    INSERT INTO globalprefs VALUES (3,'RESTRICTED_USERS','www,ftp,mail,ns1');
    INSERT INTO globalprefs VALUES (4,'ZONETYPE','STANDALONE');
    INSERT INTO globalprefs VALUES (5,'NDC_PATH','/usr/sbin/ndc');
    INSERT INTO globalprefs VALUES (6,'ZONEFILE','/var/named/dyn.example.com.db');
    INSERT INTO globalprefs VALUES (7,'GNUDIP_DOMAIN','dyn.example.com');
    INSERT INTO globalprefs VALUES (8,'COOKIE_DOMAIN','.example.com');
    INSERT INTO globalprefs VALUES (9,'ALLOW_CHANGE_HOSTNAME','NO');
    INSERT INTO globalprefs VALUES (10,'HEADER_FILE','');
    INSERT INTO globalprefs VALUES (11,'DOMAIN_TYPE','INDIVIDUAL');
    INSERT INTO globalprefs VALUES (12,'SHOW_DOMAINLIST','YES');
    INSERT INTO globalprefs VALUES (13,'ALLOW_CHANGE_DOMAIN','NO');
    
    #
    # Table structure for table 'queue'
    #
    CREATE TABLE queue (
      id int(10) NOT NULL auto_increment,
      hostname varchar(20) DEFAULT '' NOT NULL,
      domain varchar(50),
      ipaddress varchar(20),
      action enum('MODIFY','REMOVE'),
      PRIMARY KEY (id)
    );
    
    #
    # Dumping data for table 'queue'
    #
    
    
    #
    # Table structure for table 'users'
    #
    CREATE TABLE users (
      id int(10) NOT NULL auto_increment,
      username varchar(20) DEFAULT '' NOT NULL,
      password varchar(32),
      domain varchar(50) DEFAULT '' NOT NULL,
      email varchar(50),
      createdate datetime,
      forwardurl varchar(60),
      updated datetime,
      level enum('USER','ADMIN') DEFAULT 'USER' NOT NULL,
      currentip varchar(15),
      autourlon varchar(5),
      PRIMARY KEY (id),
      KEY domain (domain),
      KEY username (username)
    );
    
    #
    # Dumping data for table 'users'
    #
    
    INSERT INTO users VALUES (1,'admin','4ce340a2eb6368b8d275e3b2a49b3295','dyn.cheapnet.net','','1999-09-02 10:02:59','http://gnudip.cheapnet.net','1999-10-16 19:14:24','ADMIN','158.222.90.4','NO');
    

    e.g.

    mysql -ugnudip -p gnudip2 < gnudip2.sql
    
  5. Go to http://www.yourdomain.com/cgi-bin/gnudip2.cgi

  6. Log in with user: admin password: GnuDIP

  7. Go to Manage Users to change admin password. Note that you will have to log in again after changing password.

  8. Go to Administrative Settings and change:

    • GnuDIP domain - Set it to be the dynamic domain
    • Path to DNS zone file - In clean Ubuntu, it should be in /etc/bind
    • Path to ndc - Change to /usr/sbin/rndc
    • Cookie domain - Change to the current domain
  9. Go to Manage Users and save admin setting again

  10. Start gnudip

    sudo /etc/init.d/gnudip start
    
  11. Go to Change hostname to ...

  12. Try to resolve username.domain. For admin it is admin.domain.com

Anyway, I just noticed that gnudip installed from apt is just 2.1.1. The most recent version is 2.3.5. Oh, no! I will try to make a deb for 2.3.5 later.

Tags: ,

Post new comment