lost and found ( for me ? )

Showing posts with label build BIND10 from source. Show all posts
Showing posts with label build BIND10 from source. Show all posts

build BIND 10 from source on Ubuntu 12.04 and load a zone as a master


# tail -1 /etc/lsb-release
DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"

# uname -ri
3.2.0-38-generic x86_64

install required packages to build BIND10
# apt-get install g++ python3 python3-dev libbotan1.8-dev libbz2-dev libgmp3-dev bzip2 make libboost-dev pkg-config libsqlite3-dev sqlite3 liblog4cplus-dev automake libtool -y

build BIND10
# tar xzvf bind10-1.0.0.tar.gz
# cd bind10-1.0.0/

# ./configure
<snip>

    BIND 10 source configure results:
   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Package:
 Name:          bind10
 Version:       1.0.0

C++ Compiler:    g++

Flags:
 DEFS:          -DHAVE_CONFIG_H
 CPPFLAGS:       -DOS_LINUX  -I$(top_srcdir)/ext/asio -I$(top_srcdir)/ext/coroutine -DASIO_DISABLE_THREADS=1
 CXXFLAGS:      -g -O2
 LDFLAGS:        -Wl,-R/usr/lib   
 B10_CXXFLAGS:   -Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -Werror -fPIC
 OS Family:     Linux
 Python:        -I/usr/include/python3.2mu -I/usr/include/python3.2mu
                
                 -L/usr/lib/python3.2/config-3.2mu  -Wl,-R/usr/lib/python3.2/config-3.2mu
                -lpython3.2
 Boost:         
 Botan:         -I/usr/include
                 -L/usr/lib
                -L/usr/lib -lbotan  -lbotan
 Log4cplus:     
                 -llog4cplus -pthread
 SQLite:         
                -lsqlite3  

Features:
  SQLite3

Developer:
 Enable Debugging: no
 Google Tests: no
 Valgrind: not found
 C++ Code Coverage: no
 Python Code Coverage: no
 Logger checks: no
 Generate Documentation: no


 Now you can type "make" to build BIND 10

# make
# make install
# ldconfig

# /usr/local/sbin/bind10 --version
bind10 20110223 (BIND 10 1.0.0)


create a user
root@ubuntu1204-vm1:~# cd /usr/local/etc/bind10/

root@ubuntu1204-vm1:/usr/local/etc/bind10# b10-cmdctl-usermgr
Desired Login Name:bind10
Choose a password:
Re-enter password:

create new account successfully!

start BIND10
root@ubuntu1204-vm1:/usr/local/etc/bind10# bind10 &
[1] 16543

start Authoritative DNS service
root@ubuntu1204-vm1:/usr/local/etc/bind10# bindctl
No stored password file found, please see sections "Configuration specification for b10-cmdctl" and "bindctl command-line options" of the BIND 10 guide.
Username: bind10
Password:
["login success "]

> config add Init/components b10-auth
> config set Init/components/b10-auth/special auth
> config set Init/components/b10-auth/kind needed
> config commit
2013-02-28 00:56:19.911 INFO  [b10-init.init/16543] BIND10_CONFIGURATOR_RECONFIGURE reconfiguring running components
2013-02-28 00:56:19.912 INFO  [b10-init.init/16543] BIND10_COMPONENT_START component b10-auth is starting
2013-02-28 00:56:19.914 INFO  [b10-init.init/16543] BIND10_STARTING_PROCESS starting process b10-auth
> 2013-02-28 00:56:19.971 INFO  [b10-auth.auth/16574] AUTH_SERVER_CREATED server created
2013-02-28 00:56:19.972 INFO  [b10-auth.auth/16574] AUTH_DATASRC_CLIENTS_BUILDER_STARTED data source builder thread started
2013-02-28 00:56:19.981 INFO  [b10-init.init/16543] BIND10_SOCKET_GET requesting socket [::]:53 of type TCP from the creator
2013-02-28 00:56:19.983 INFO  [b10-init.init/16543] BIND10_SOCKET_CREATED successfully created socket 20
2013-02-28 00:56:19.986 INFO  [b10-init.init/16543] BIND10_SOCKET_GET requesting socket [::]:53 of type UDP from the creator
2013-02-28 00:56:19.988 INFO  [b10-init.init/16543] BIND10_SOCKET_CREATED successfully created socket 22
2013-02-28 00:56:19.990 INFO  [b10-init.init/16543] BIND10_SOCKET_GET requesting socket [0.0.0.0]:53 of type TCP from the creator
2013-02-28 00:56:19.991 INFO  [b10-init.init/16543] BIND10_SOCKET_CREATED successfully created socket 23
2013-02-28 00:56:19.994 INFO  [b10-init.init/16543] BIND10_SOCKET_GET requesting socket [0.0.0.0]:53 of type UDP from the creator
2013-02-28 00:56:19.996 INFO  [b10-init.init/16543] BIND10_SOCKET_CREATED successfully created socket 24
2013-02-28 00:56:20.002 INFO  [b10-auth.auth/16574] AUTH_DATASRC_CLIENTS_BUILDER_RECONFIGURE_STARTED data source reconfiguration started
2013-02-28 00:56:20.004 INFO  [b10-auth.auth/16574] AUTH_SERVER_STARTED server started
2013-02-28 00:56:20.010 WARN  [b10-auth.datasrc/16574] DATASRC_SQLITE_SETUP setting up new SQLite3 database in '/usr/local/var/bind10/zone.sqlite3'
2013-02-28 00:56:20.175 INFO  [b10-auth.auth/16574] AUTH_DATASRC_CLIENTS_BUILDER_RECONFIGURE_SUCCESS data source reconfiguration completed successfully

> quit

Exit from bindctl
#

# lsof -ni:53
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
b10-init 16543 root   20u  IPv6  36053      0t0  TCP *:domain (LISTEN)
b10-init 16543 root   22u  IPv6  36057      0t0  UDP *:domain
b10-init 16543 root   23u  IPv4  36058      0t0  TCP *:domain (LISTEN)
b10-init 16543 root   24u  IPv4  36060      0t0  UDP *:domain
b10-auth 16574 root   16w  IPv6  36053      0t0  TCP *:domain (LISTEN)
b10-auth 16574 root   17w  IPv6  36057      0t0  UDP *:domain
b10-auth 16574 root   18r  IPv4  36058      0t0  TCP *:domain (LISTEN)
b10-auth 16574 root   19u  IPv4  36060      0t0  UDP *:domain

# dig @127.0.0.1 version.bind chaos txt +norec

; <<>> DiG 9.8.1-P1 <<>> @127.0.0.1 version.bind chaos txt +norec
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56466
;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;version.bind. CH TXT

;; ANSWER SECTION:
version.bind. 0 CH TXT "bind10 1.0.0"

;; AUTHORITY SECTION:
bind. 0 CH NS bind.

recursive service is not running
# dig @127.0.0.1 www.isc.org

; <<>> DiG 9.8.1-P1 <<>> @127.0.0.1 www.isc.org
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 40243
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;www.isc.org. IN A



load a zone “foo.bar”
# cat foo.bar.db
$TTL 84600
foo.bar. 3600 IN SOA ns1.foo.bar. (
postmaster.foo.bar.
2013022801;
3600;
900
604800
3600 )

foo.bar. IN NS ns1.foo.bar.
        IN NS ns2.foo.bar.
ns1.foo.bar. IN A 127.0.0.1
ns2.foo.bar. IN A 127.0.0.2
www.foo.bar. IN A 127.0.0.3
    IN A 127.0.0.4
    IN A 127.0.0.5



# b10-loadzone -c '{"database_file": "/usr/local/var/bind10/zone.sqlite3"}' foo.bar foo.bar.db
2013-02-28 01:04:07.891 INFO  [b10-loadzone.loadzone/16705] LOADZONE_ZONE_CREATED Zone foo.bar./IN does not exist in the data source, newly created
2013-02-28 01:04:08.013 INFO  [b10-loadzone.loadzone/16705] LOADZONE_DONE Loaded 8 RRs into zone foo.bar./IN in 0.12 seconds

zone configuration was stored in /usr/local/var/bind10/zone.sqlite3.
# ls /usr/local/var/bind10/
b10-config.db  logger_lockfile  msgq_socket  zone.sqlite3

# dig @127.1 www.foo.bar +norec

; <<>> DiG 9.8.1-P1 <<>> @127.1 www.foo.bar +norec
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5707
;; flags: qr aa; QUERY: 1, ANSWER: 3, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;www.foo.bar. IN A

;; ANSWER SECTION:
www.foo.bar. 84600 IN A 127.0.0.3
www.foo.bar. 84600 IN A 127.0.0.4
www.foo.bar. 84600 IN A 127.0.0.5

;; AUTHORITY SECTION:
foo.bar. 84600 IN NS ns1.foo.bar.
foo.bar. 84600 IN NS ns2.foo.bar.

;; ADDITIONAL SECTION:
ns1.foo.bar. 84600 IN A 127.0.0.1
ns2.foo.bar. 84600 IN A 127.0.0.2


stop BIND10 process
# bindctl

> Init show_processes help
Command  show_processes (List the running BIND 10 processes)
help (Get help for command)
This command has no parameters
> Init show_processes
[
   [
       16544,
       "Socket creator",
       null
   ],
   [
       16545,
       "msgq",
       null
   ],
   [
       16547,
       "cfgmgr",
       "ConfigManager"
   ],
   [
       16549,
       "b10-stats",
       "Stats"
   ],
   [
       16550,
       "b10-cmdctl",
       "Cmdctl"
   ],
   [
       16574,
       "b10-auth",
       "Auth"
   ]
]
> Init shutdown
2013-02-28 01:08:28.680 INFO  [b10-init.init/16543] BIND10_SHUTDOWN stopping the server
2013-02-28 01:08:28.681 INFO  [b10-init.init/16543] BIND10_CONFIGURATOR_STOP bind10 component configurator is shutting down
2013-02-28 01:08:28.683 INFO  [b10-init.init/16543] BIND10_COMPONENT_STOP component Socket creator is being stopped
2013-02-28 01:08:28.684>  INFO  [b10-init.init/16543] BIND10_SOCKCREATOR_TERMINATE terminating socket creator
2013-02-28 01:08:28.690 INFO  [b10-init.init/16543] BIND10_COMPONENT_STOP component msgq is being stopped
2013-02-28 01:08:28.694 INFO  [b10-init.init/16543] BIND10_COMPONENT_STOP component b10-cmdctl is being stopped
2013-02-28 01:08:28.699 INFO  [b10-init.init/16543] BIND10_STOP_PROCESS asking b10-cmdctl to shut down
2013-02-28 01:08:28.705 INFO  [b10-cmdctl.cmdctl/16550] CMDCTL_EXITING exiting
2013-02-28 01:08:28.709 INFO  [b10-init.init/16543] BIND10_COMPONENT_STOP component b10-auth is being stopped
2013-02-28 01:08:28.710 INFO  [b10-init.init/16543] BIND10_STOP_PROCESS asking b10-auth to shut down
2013-02-28 01:08:28.712 INFO  [b10-auth.auth/16574] AUTH_SERVER_EXITING exiting
2013-02-28 01:08:28.714 INFO  [b10-auth.auth/16574] AUTH_DATASRC_CLIENTS_BUILDER_STOPPED data source builder thread stopped
2013-02-28 01:08:28.724 INFO  [b10-init.init/16543] BIND10_COMPONENT_STOP component cfgmgr is being stopped
2013-02-28 01:08:28.725 INFO  [b10-init.init/16543] BIND10_STOP_PROCESS asking cfgmgr to shut down
2013-02-28 01:08:28.727 INFO  [b10-cfgmgr.cfgmgr/16547] CFGMGR_STOPPED_BY_COMMAND received shutdown command, shutting down
2013-02-28 01:08:28.732 INFO  [b10-init.init/16543] BIND10_COMPONENT_STOP component b10-stats is being stopped
2013-02-28 01:08:28.736 INFO  [b10-init.init/16543] BIND10_STOP_PROCESS asking b10-stats to shut down
2013-02-28 01:08:28.738 INFO  [b10-stats.stats/16549] STATS_RECEIVED_SHUTDOWN_COMMAND shutdown command received
2013-02-28 01:08:28.740 INFO  [b10-stats.stats/16549] STATS_EXITING exiting
2013-02-28 01:08:29.749 INFO  [b10-init.init/16543] BIND10_PROCESS_ENDED process 16544 of Socket creator ended with status 0
2013-02-28 01:08:29.754 INFO  [b10-init.init/16543] BIND10_PROCESS_ENDED process 16547 of cfgmgr ended with status 0
2013-02-28 01:08:29.759 INFO  [b10-init.init/16543] BIND10_PROCESS_ENDED process 16549 of b10-stats ended with status 0
2013-02-28 01:08:29.764 INFO  [b10-init.init/16543] BIND10_PROCESS_ENDED process 16550 of b10-cmdctl ended with status 0
2013-02-28 01:08:29.766 INFO  [b10-init.init/16543] BIND10_PROCESS_ENDED process 16574 of b10-auth ended with status 0
2013-02-28 01:08:29.768 INFO  [b10-init.init/16543] BIND10_SEND_SIGTERM sending SIGTERM to msgq (PID 16545)
2013-02-28 01:08:29.877 INFO  [b10-init.init/16543] BIND10_PROCESS_ENDED process 16545 of msgq ended with status 0
2013-02-28 01:08:29.883 INFO  [b10-init.init/16543] BIND10_SHUTDOWN_COMPLETE all processes ended, shutdown complete

Failed to send request, the connection is closed
[1]+  Done                    bind10  (wd: /usr/local/etc/bind10)
(wd now: /home/hattori/BIND10_works)