Archive for August, 2009

geodns-new.pl

modified the geodns.pl from the original setup. Most of the file is still largely the same as the original. Added in some functions to support the new views management functions and modified the old ones to support weight configuration.

geodns-new.pl

30/10/2009: Updated the file link, no change in content though.

web UI

Finally publishing the web UI.

This is a PHP script, hence, PHP need to be installed on the server. PHP 5 to be exact

The database configuration can be done by modifying the variables in sql.php

 

Web UI

Configuration Download Script

to automate the comparison and download process of the generated configuration file (from WebUI), the following shell script could be used.

simply replace the following to use the script.

filePath="/var/named/downloaded.views"; #change the filepath to the destination file desired.

replace all http://12.7.0.0.1 with the location where the webUI is hosted.

 

getConfig.sh

testing tool

custom created a testing tool that performs simple load testing on the DNS server.

The main feature of the tool allows the results to be saved into the database table (schema provided below) and then displaying the statistics of each result at the end of the test. This allows easy verification of the weights configured on the records.

sample output:

Retriving results for test: 4
Number of results:100000
Formatting output…
Query: releases.geo.mozilla.com
Test started on: 2009-08-05 20:41:41
155.98.64.83    17699(17.70%)
149.20.20.5     17613(17.61%)
129.101.198.59  13460(13.46%)
128.61.111.9    13320(13.32%)
204.152.184.113 6751(6.75%)
202.177.202.154 6693(6.69%)
131.188.12.212  6564(6.56%)
156.56.247.196  4437(4.44%)
64.50.236.214   2365(2.37%)
64.50.238.52    2268(2.27%)
64.50.236.52    2264(2.26%)
204.152.184.196 2231(2.23%)
216.165.129.141 2191(2.19%)
204.246.0.136   2144(2.14%)
Average Query Time: 0.00868 seconds

Files:

loadDNS.pl
database-testLoad.sql

database countries

To populate the countries in the geoip_geo table, the following file can be used to insert all countries available in the GeoLite Country database into the table.

geoip_geo is used to provide the countries available for matching to views.

databsae-geoip-countries.sql

database schema (upgrade)

If the database were already containing the old table. Perform the following to upgrade the database

update releases-geo using the upgrade file
    [jiajun@sm-geodnssoc ~]$ mysql -u user -p geo-mozilla-com< database-upgrade.sql

create the new tables and stored procedures
    [jiajun@sm-geodnssoc ~]$ mysql -u user -p geo-mozilla-com< database.sql

rebuild the views either from geodns.pl/web UI/mysql before restarting the DNS server
    [jiajun@sm-geodnssoc ~]$ mysql –u user –p
    mysql> call buildViews();

 

database-upgrade.sql

database.sql

database schema

Uploading the database schema. To create the MySQL DB for Bind’s usage, simply create and database and use the file to create the tables and stored procedures.

Example.

[jiajun@sm-geodnssoc ~]$ mysql –u user –p
mysql> CREATE DATABASE `geo-mozilla-com`;
mysql> exit
[jiajun@sm-geodnssoc ~]$ mysql -u user -p geo-mozilla-com< database.sql

rebuild the views either from geodns.pl/web UI/mysql before restarting the DNS server
    [jiajun@sm-geodnssoc ~]$ mysql –u user –p
    mysql> call buildViews();

NOTE: I had reuploaded the schema file on 5 Aug 2337 hrs (GMT +8).

Changes:

- the new version does not drop the table if it exists. It will create the table only if it does not exists. However, stored procedures will always be recreated.

 

Files:

Database Schema

Generated Diff

finished testing the diff file yesterday.

Downloaded bind-9.4.3-P3.tar.gz and made sure the codes work against it and the generated the patch by comparing the original files with the modified ones.

The diff included modifications to enable the dlz driver so that the vanilla codes can be changed without much intervention.

To replicate the results, the instructions are as follows:

  • download bind-9.4.3-P3.tar.gz
  • download mysql-bind.tar.gz
  • copy bind-9.4.3-P3.tar.gz to <Base Directory>
  • copy mysql-bind.tar.gz to <Base Directory>
  • cd <Base Directory>
  • tar -zxvf bind-9.4.3-P3.tar.gz
  • tar -zxvf mysql-bind.tar.gz
  • patch -p0 < ../allpatch.diff
  • cd bind-9.4.3-P3/bin/named/
  • ln -s ../../../mysql-bind/mysqldb.c mysqldb.c
  • cd include/named/
  • ln -s ../../../../../mysql-bind/mysqldb.h mysqldb.h
  • cd <Base Directory>/bind-9.4.3-P3
  • ./configure  –disable-openssl-version-check CFLAGS="-I/usr/local/include/" LDFLAGS="-L/usr/local/lib -lGeoIP"
  • make
  • sudo make install

The software requirements before the software to compile is that the geoIP API must be installed.

The files:

- Bind 9.4.3-P3

- MySQL-BIND DLZ

- THE patch: