mysql > update mysql. user set password = PASSWORD ( '123456' ) where user = 'root' ;
mysql > flush privileges ;
mysql > create database dnsdb default character set utf8 collate utf8_general_ci;
mysql > create user 'dnsdb' @ 'localhost' identified by '123456' ;
mysql > grant all on dnsdb.* to 'dnsdb' @ 'localhost' identified by '123456' ;
mysql > CREATE TABLE `dns_records` (
- > `id` int (10) unsigned NOT NULL auto_increment ,
- > `zone` varchar (255) NOT NULL ,
- > ` host ` varchar (255) NOT NULL default '@' ,
- > ` type ` enum ( 'MX' , 'CNAME' , 'NS' , 'SOA' , 'A' , 'PTR' ) NOT NULL ,
- > `data` varchar (255) default NULL ,
- > `ttl` int (11) NOT NULL default '120' ,
- > ` view ` char (20) default 'DF' ,
- > `mx_priority` int (11) default NULL ,
- > `refresh` int (11) NOT NULL default '3600' ,
- > `retry` int (11) NOT NULL default '3600' ,
- > `expire` int (11) NOT NULL default '86400' ,
- > `minimum` int (11) NOT NULL default '3600' ,
- > `serial` bigint (20) NOT NULL default '2015050100' ,
- > `resp_person` varchar (64) NOT NULL default 'root.t4x.org.' ,
- > `primary_ns` varchar (64) NOT NULL default 'ns1.t4x.org.' ,
- > `data_count` int (11) NOT NULL default '0' ,
- > PRIMARY KEY (`id`),
- > KEY ` type ` (` type `),
- > KEY ` host ` (` host `),
- > KEY `zone` (`zone`)
- > ) ENGINE = MyISAM AUTO_INCREMENT = one DEFAULT CHARSET = utf8;
Query OK, zero rows affected (0.13 sec)
mysql > desc dns_records;
+-------------+-----------------------------------------+------+-----+---------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-----------------------------------------+------+-----+---------------+----------------+
| id | int (10) unsigned | NO | PRI | NULL | auto_increment |
| zone | varchar (255) | NO | MUL | NULL | |
| host | varchar (255) | NO | MUL | @ | |
| type | enum ( 'MX' , 'CNAME' , 'NS' , 'SOA' , 'A' , 'PTR' ) | NO | MUL | NULL | |
| data | varchar (255) | YES | | NULL | |
| ttl | int (11) | NO | | one hundred and twenty | |
| view | char (20) | YES | | DF | |
| mx_priority | int (11) | YES | | NULL | |
| refresh | int (11) | NO | | three thousand and six hundred | |
| retry | int (11) | NO | | three thousand and six hundred | |
| expire | int (11) | NO | | eighty-six thousand and four hundred | |
| minimum | int (11) | NO | | three thousand and six hundred | |
| serial | bigint (20) | NO | | two billion fifteen million fifty thousand and one hundred | |
| resp_person | varchar (64) | NO | | root.t4x.org. | |
| primary_ns | varchar (64) | NO | | ns1.t4x.org. | |
| data_count | int (11) | NO | | zero | |
+-------------+-----------------------------------------+------+-----+---------------+----------------+
sixteen rows in set (0.06 sec)
mysql > INSERT INTO `dns_records` (`zone`, ` host `, ` type `, `data`, `ttl`,`mx_priority`, `refresh`, `retry`, `expire`,
- > `minimum`, `serial`, `resp_person`, `primary_ns`, `data_count`) VALUES
- > ( 't4x.org' , '@' , 'SOA' , 'ns1.t4x.org.' , 10, NULL , 3600, 3600, 86400, 10, 2015050200, 'root.t4x.org.' , 'ns1.t4x.org.' , 0);
Query OK, one row affected (0.12 sec)
mysql > INSERT INTO `dns_records` (`zone`,` host `, ` type `, `data`) VALUES
- > ( 't4x.org' , '@' , 'NS' , 'ns1.t4x.org.' ),
- > ( 't4x.org' , '@' , 'NS' , 'ns2.t4x.org.' );
Records: two Duplicates: zero Warnings : zero
mysql > INSERT INTO `dns_records` (`zone`, ` host `, ` type `, `data`) VALUES
- > ( 't4x.org' , 'ns1' , 'A' , '1.1.1.19' ),
- > ( 't4x.org' , 'ns2' , 'A' , '1.1.1.20' );
Query OK, two rows affected (0.00 sec)
Records: two Duplicates: zero Warnings : zero
mysql > INSERT INTO `dns_records` (`zone`, ` host `, ` type `, `data`, `ttl`, ` view `) VALUES
- > ( 't4x.org' , 'www' , 'A' , '1.1.1.1' , 3600, 'LOCAL' ),
- > ( 't4x.org' , 'www' , 'A' , '2.2.2.2' , 3600, 'CTCC' ),
- > ( 't4x.org' , 'www' , 'A' , '3.3.3.3' , 3600, 'CUCC' ),
- > ( 't4x.org' , 'www' , 'A' , '4.4.4.4' , 3600, 'CMCC' ),
- > ( 't4x.org' , 'www' , 'A' , '5.5.5.5' , 3600, 'CECC' ),
- > ( 't4x.org' , 'www' , 'A' , '6.6.6.6' , 3600, 'OTHERS' );
Query OK, six rows affected (0.00 sec)
Records: six Duplicates: zero Warnings : zero
mysql > INSERT INTO `dns_records` (`zone`, ` host `, ` type `, `data`, `ttl`, ` view `) VALUES
- > ( 't4x.org' , 'bbs' , 'A' , '11.11.11.11' , 3600, 'LOCAL' ),
- > ( 't4x.org' , 'bbs' , 'A' , '22.22.22.22' , 3600, 'CTCC' ),
- > ( 't4x.org' , 'bbs' , 'A' , '33.33.33.33' , 3600, 'CUCC' ),
- > ( 't4x.org' , 'bbs' , 'A' , '44.44.44.44' , 3600, 'CMCC' ),
- > ( 't4x.org' , 'bbs' , 'A' , '55.55.55.55' , 3600, 'CECC' ),
- > ( 't4x.org' , 'bbs' , 'A' , '66.66.66.66' , 3600, 'OTHERS' );
Query OK, six rows affected (0.00 sec)
Records: six Duplicates: zero Warnings : zero
mysql > INSERT INTO dns_records (zone, host , type ,DATA, view ) VALUES
- > ( 't4x.org' , 'blog' , 'CNAME' , 'www' , 'LOCAL' ),
- > ( 't4x.org' , 'blog' , 'CNAME' , 'www' , 'CTCC' ),
- > ( 't4x.org' , 'blog' , 'CNAME' , 'www' , 'CUCC' ),
- > ( 't4x.org' , 'blog' , 'CNAME' , 'www' , 'CMCC' ),
- > ( 't4x.org' , 'blog' , 'CNAME' , 'www' , 'CECC' ),
- > ( 't4x.org' , 'blog' , 'CNAME' , 'www' , 'OTHERS' );
Query OK, six rows affected (0.00 sec)
Records: six Duplicates: zero Warnings : zero