README
上传用户:raihanchen
上传日期:2022-08-07
资源大小:129k
文件大小:14k
源码类别:

网络

开发平台:

Visual C++

  1. This release 6.4 is a Stable Release
  2. PURPOSE
  3. DHCP Server allots the IP addresses to local computers, while DNS server resolves
  4. them.
  5. You need DHCP Server if you do not want to manually maintain IP Addresses or
  6. you have less IP Addresses than number of machines you have, as dynamic DHCP Server will
  7. recycle IP Addresses on machines.
  8. DNS Server is needed for resolving hostnames to their IP addresses. Normally your
  9. ISP will provide you with DNS Service. You may have your own DNS Server, which will
  10. resolve hostnames by forwarding them to ISP's DNS Server and cache the addresses also.
  11. If you have home/small office network with some Unix/Linux machines, these machines will
  12. not be resolved from each other, as Unix/Linux machines do not support NBNS protocol
  13. and you need your own DNS Server.
  14. Now how about resolving your local machines ?. Your ISP's DNS Server will not have
  15. this list and your own DNS Server wont have this either. Most DNS Servers cannot do this.
  16. (unless you configure dynamic updates, or use static IP addresses and manually enter them).
  17. THIS SERVER RESOLVES DHCP ALLOTED LOCAL MACHINES AUTOMATICALLY, IN ADDITION TO EXTERNAL
  18. HOSTS, WITH THE ADDED ADVANTAGE BEING, BOTH DHCP AND DNS SERVER ARE ALLWAYS IN SYNC. 
  19. You may also like to use this DNS Server as caching proxy for your IPS's server for fast
  20. response. You can disable DHCP Server, if you use static addresses or there is another
  21. DHCP Server being used. Even if you have only one machine you can try it. Enable only
  22. DNS Service, specify remote DNS Servers in ini file and set DNS Server of your machine
  23. to itself. If you only have dialup, create loopback adaptor for testing.
  24. ENHANCEMENTS in 6.42
  25. 1) Logging Mechanism changed. Now there can be a daily new log file, Do achive this,
  26.    please include %Y for full year or %y for 2 digit year, %m for month, %d for day
  27.    of month. Log file will never be overwritten. Log file for DHCP should be archived
  28.    for finding out the Mac Address against an IP in future. You can also include just
  29.    %m and %Y if you want monthly log file like .../dualserver%Y%m.log
  30. ENHANCEMENTS in 6.4
  31. 1) Multiple filters of each type can be specified in a range. If any filter matches,
  32. it would be match.
  33. ENHANCEMENTS in 6.3
  34. 1) Minor Bug Fixes
  35. ENHANCEMENTS in 6.24
  36. 1) Vendor Class Filter has been added to filter DHCP-RANGE sections.
  37. 2) User Class Filter has been added to filter DHCP-RANGE sections.
  38. ENHANCEMENTS in 6.2
  39. 1) Mac Range has been added to filter DHCP-RANGE sections.
  40. 2) DHCP Replication minor bug fixes.
  41. ENHANCEMENTS in 6.0
  42. 1) Http Interface for lease status has been introduced.
  43. 2) DHCP Lease time can be different for any client or for entire DHCP Range.
  44. 3) Minor Bug Fixes in DHCP area.
  45. ENHANCEMENTS in 5.2
  46. 1) DHCP Options can be specified on DHCP Range Basis also.
  47. 2) ClientID, if sent by Client, is returned with DHCP messages.
  48. Bugs Fixed in 5.1
  49. 1) Zone Replication Bugs.
  50. ENHANCEMENTS in 5.0
  51. 1) This release supports Zone Transfer and Replication.
  52. BUGS Fixed in 4.1
  53. 1) BootP Support fixed.
  54. ENHANCEMENTS in version 4.0
  55. 1) Multiple Ranges can be specified.
  56. 2) Different physical network can be served by this server using DCHP Relay Agent.
  57. 3) Single host can have multiple IPs and single IP can have multiple hosts.
  58. 4) Zone based DNS Query routing [DNS-PROXY] is introduced.
  59. 5) Logging added.
  60. 6) Multiple listening interfaces can be specified for multihome servers.
  61. Other features
  62. 1) Requires little configuration and no need to create zone files.
  63. 2) Provides both DHCP and DNS Service, can also use one of them only.
  64. 3) Automatic built-in dynamic updates. DNS Server includes DHCP allotted names.
  65. 4) Unlimited no. of hosts and aliases can be specified.
  66. 5) No limit to cached external hosts.
  67. 6) Both global and client specific DHCP Options.
  68. 7) Network PXE Boot and BOOTP support.
  69. 8) Zone based DNS Query routing (DNS Proxing) to different DNS Servers.
  70. DOWNLOAD
  71. The latest version can be downloaded from http://dhcp-dns-server.sourceforge.net/
  72. INSTALLATION
  73. This program if installed on a machine, which is static configured for IP Address,
  74. DNS & router, it detects these settings from server machine (If you want different
  75. setting for clients, edit ini file) and uses them for configuring other machines
  76. on local network.
  77. Expand the GZ archive to any directory (say /opt/dualserver)
  78. Change the permissions of file dualserver with chmod 755 dualserver
  79. test run as root:-
  80. #/opt/dualserver/dualserver -v
  81. You should see something similar to:-
  82. Forwarding DNS Server: 192.168.0.1
  83. DHCP Range: 192.168.0.1-192.168.0.254/255.255.255.0
  84. DNS Service Permitted Hosts: 192.168.0.1 - 192.168.0.254
  85. Expiry: 360000 (sec)
  86. Domain Name: workgroup
  87. Server Name: Knoppix
  88. Listening On: 192.168.0.2
  89. Now try getting IP Address for another machine, it should work.
  90. RUNNING
  91. This program runs in two modes:-
  92. a) Verbatim Mode (using -v argument)
  93. b) Daemon (not using -v argument)
  94. This program uses 2 or 3 helper files:-
  95. i)   -i[inifile], where configuration settings can be specified,
  96.      default is ./etc/dualserver.ini
  97. ii)  -s[statefile] saves current leases, default is /etc/dualserver.state 
  98. iii) -l[logfile] dumps log to this file in daemon mode, default is syslog
  99. You can start/run as:-
  100. /opt/dualserver/dualserver (daemon with default files)
  101. /opt/dualserver/dualserver -v (verbatim with default files)
  102. /opt/dualserver/dualserver -i inifile -s statefile -l logfile (as daemon)
  103. /opt/dualserver/dualserver -i inifile -s statefile (as daemon)
  104. /opt/dualserver/dualserver  -v -i inifile -s statefile as verbatim
  105. Please include %Y for full year or %y for 2 digit year, %m for month, %d for day
  106. of month like:-
  107. /opt/dualserver/dualserver -l /opt/dualserver/log/dualserver%Y%m%d.log -i/opt/dualserver/dualserver.ini
  108. Order of %Y %m %d is not important. You can also include just %m and %Y if you want monthly log file like:-
  109. /<installDirecory>/dualserver -l <logDirecory>/dualserver%Y%m.log -i<someDirecory>/dualserver.ini
  110. As shown above if you use separate directory for log file, you should manually create this directory
  111. DAEMONIZING
  112. This program should be setup to start automatically
  113. modifying boot scripts in /etc/rc.d/rc.local file
  114. or /etc/inittab file or /etc/rc.d/rc.inet2 file.
  115. Never include -v (verbatim flag) while running
  116. as Daemon from these scripts. There are two alternatives:-
  117. i)  Just add the start line in any of above files.
  118. ii) Add the enclosed rc.dualserver script in /etc/rc.d
  119.     and make it executable (755). Also you need to add the
  120.     lines:-
  121.     
  122.     # Start the Dual DHCP DNS Server daemon:
  123.     if [ -x /etc/rc.d/rc.dualserver ]; then
  124.       /etc/rc.d/rc.dualserver start
  125.     fi
  126.     to any of above scripts (preferably to /etc/rc.d/rc.inet2)
  127. Alternative ii) is recommended
  128. RECOMPILING
  129. Recompiling is not generally needed on Intel/Linux systems.
  130. #g++ dualserver.cpp -odualserver -lpthread
  131. You need C++ compiler for Versions 3 onwards, as these versions use STL
  132. If you have only C Compiler, you need to download and use Version 2.1 only.
  133. CONFIGURATION
  134. 1) Configuration of Server
  135.    The program automatically picks up settings of Server computer and 
  136.    no configuration is required if:-
  137.    a) Server machine is configured for DNS Servers and Gateway servers.
  138.    b) You use IP range 192.168.0.1 - 192.168.0.255 (Server is automatically excluded).
  139.    c) Lease Time is 360000 secs/100 hours.
  140.    
  141.    You can change any of these settings in DualServer.ini file.
  142.    
  143. 2) Configuration of Clients
  144.    a. You can use windows/Linux/Unix mix of clients.
  145.    b. The clients should be set to get IP Address automatically.
  146.    c. Do not configure the clients for Dynamic DNS Update, as this server automatically
  147.       does this.
  148. GENERAL
  149.    
  150. 1) This document is for guidance and is covered under GNU public license.
  151. INTERNET CONNECTION SHARING.
  152. Internet connection sharing needs 3 services a) DNS Server b) DHCP Service c) Gateway Service.
  153. DNS and DHCP Service is provided by this server. However gateway service is provided by 
  154. Operating System itself.
  155. To enable Internet connection sharing, please look at instruction at /etc/rc.d/rc.ip_forward file.
  156. DEBUG
  157. If program is not assigning addresses or resolve them check:-
  158. 1) Ensure that you run this program as root only.
  159. 2) Check network hardware and ensure that client machines has different host names from server and
  160.    each other.
  161. 3) No other service should be running on Server on ports 53 and 67.
  162. 4) If you get error like port 67 already in use means some other DHCP program or proxy server with DHCP 
  163.    service is running. If you get error port 53 already in use means some other DNS Server or proxy server
  164.    with DNS Service is already running. Use netstat command to detect which program is
  165.    listening on these ports. It is also possible that another copy of dualserver itself is running.
  166. 5) If you get error Static Interfaces/Listening Ports not available, it may be because of 1) Another
  167.    DHCP/DNS Server is running or Interfaces specified on [LISTEN-ON] section are not available.
  168.    or you have just restated the server and TCP port is not yet closed, then wait for some time.
  169. 6) Look at log file (if running as service) or Run in standalone mode, it will provide all debug
  170.    information as it verbatim the activities.
  171. 7) If you use Broadband router, which also has DHCP Server, this program may still run, but some hosts
  172.    configured by other DHCP Server may not use this DNS Service.
  173. 8) Often you will find that other machines can resolve each other and server, but server resolves
  174.    nothing. This is because server's DNS Server may be different. To resolve machines from server,
  175.    specify (forwarding) DNS Servers in ini file and set server's DNS Server to itself.
  176. 9) Zone Transfer and Replication, if used on multihomed servers, make sure the IPs for Primary and Secondary
  177.    server can be pinged from Each Other.
  178. 10)dualserver.state file backs up current leases and is read back when server restarts. If you want to 
  179.    clean previous leases, you may delete this file and restart the server.
  180. 11) Errors like "libstdc++.so.?: cannot open shared object file: No such file or directory" 
  181.    are possible in some Linux flavors. Please recompile the program or create symbolic links:-
  182. ln -s /usr/local/lib/libstdc++.so.? /usr/lib/libstdc++.so.? 
  183. ln -s /usr/local/lib/libgcc_s.so.? /usr/lib/libgcc_s.so.?
  184.    (? is library version as reported in error)
  185.    or add the library path (directory where above file is) to env variable LD_LIBRARY_PATH.
  186. 12)If you are not able to receive DHCP Discover messages from clients, make sure that Dual DHCP DNS Server
  187.    and client are on same physical network (not separated by routers). If it is separated by routers and it
  188.    is same subnet, please allow routers to pass broadcast messages to Server on Port 67. If these are 
  189.    different subnets, use the BOOTP relay agents.
  190. UNINSTALLATION
  191. Just remove the program directory. You should also remove entries from initialize scripts of 
  192. your machine.
  193. REPLICATION (for advance users only)
  194. Release 5.0 onwards support zone replication. Please read the ZONE REPLICATION file.
  195. Domain Name Server and Child Zones. (for advance users only)
  196. If you have a domain with multiple child zones, each zone having its own DNS/DHCP or DNS server, You
  197. can use a multizone DNS Server like bind as Main Domain Name Server, which would transfer different
  198. zones from child servers. Dual Server can be very well used as Child Zone Servers with DHCP/DNS for
  199. zone and Domain Name Server would have all the zones transferred from Child Servers.
  200. Dual Server, being single zone server, still provides a way to work as main Domain Name Server for
  201. whole domain. It works differently but with same results, without even the need to transfer child zones.
  202. You can configure 1 or more Dual Servers as Master DNS Server (Domain DNS Server) for whole domain
  203. and these will forward queries to specific zone servers based on zone match. Queries not matching to zones
  204. specified in [CHILD-ZONES] section will be forwarded to default forwarding DNS Servers. One query will
  205. be forwarded only once to Child server and then cache is used to resolve unless it has expired.
  206. Please see the [CHILD-ZONES] section of ini file.
  207. Entries in [CHILD-ZONES] behave differently than forwarding server entries in [DNS-SERVERS] section.
  208. Child Servers are basically meant for child  zones queries. For correct behavior you should specify
  209. child zone servers in [CHILD-ZONES] like:-
  210. [CHILD-ZONES]
  211. childzone1.workgroup.com=xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx
  212. 1.168.192.in-addr-arpa=xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx
  213. childzone2.workgroup.com=xxx.xxx.xxx.xxx
  214. 2.168.192.in-addr-arpa=xxx.xxx.xxx.xxx
  215. The child zone can have just one DNS Server or can have primary and secondary with zone replication between 
  216. them. Domain Server would contact primary or secondary child zone server, whichever is available. You can
  217. specify one server also, if child zone has only 1 server.
  218.   Main Domain Name servers should be specified as forwarding servers in child zone dns servers, so that
  219. each zone can also resolve entries in sibling child zones through main Domain Name Server. ISP or Public
  220. DNS Servers should only be specified in main Domain Name Servers.
  221. If you need full backup, minimum 2 DualServers should be used as main Domain Name Server for main domain
  222. with identical configuration and each child zone should have 2 DualServers, with zone replication between
  223. them only.
  224. BUGS
  225. If you find any problem with this program or need more features, please send mail to achaldhir@gmail.com.
  226. You may also send thanks email if it works fine for you.
  227. DONATIONS
  228. If you find that this program is suitable for your office environment and you are using it, Please consider
  229. some donation for this project. $10-$50 do not make any difference to office, but it does make difference
  230. to Project. Trust me, only 2 donations of $5 have been received since last 5 years.