BIND 在win 2003 下的安装及配置

可用于windows下的bind 立即下载

转自:http://bbs.chinaunix.net/viewthread.php?tid=596994

一.、Bind 简介。

Bind是一款开放源码的DNS服务器软件,Bind由美国加州大学Berkeley分校开发和维护的,全名为Berkeley Internet Name Domain它是目前世界上使用最为广泛的DNS服务器软件,支持各种unix平台和windows平台。本文将介绍它在win 2003 server中最基本的安装和配置。

二.、软件的相关资源及准备工作。

官方网站:http://www.bind.com/
源码软件包:Bind 是开源的软件,可以去其官方网站下载。http://www.isc.org/index.pl?/sw/bind/,目前最新版本为bind-9.3.2。
帮助文档:http://www.isc.org/index.pl?/sw/bind/ 有该软件比较全面的帮助文档。
FAQ:http://www.isc.org/index.pl/sw/bind/ 回答了该软件的常见问题。
配置文件样例:http://www.bind.com/bind.html 一些比较标准的配置文件样例。
下载 UltraEdit  因为要修改配置文件,都需要该软件 ,当然你用记事本也行,提醒你的是用记事本很容易出问题
三.、软件的安装。

1.        安装
由其官方网站中下载其源码软件包BIND9.3.2.zip 。接下来我将对安装过程的一些重要步骤,给出其解释:
2.        解压压缩包,运行安装文件bindinstall
3.        默认情况下,安装过程是不会建立配置文件和一些默认的域名解析的,不过并不妨碍,可以从下载一些标准的配置文件(http://www.bind.com/bind.html),也可以使用本文所提供的样例文件。 默认情况下,安装路径为C:/windows/system32/dns 下,可以看到有两个目录,分别为bin和etc, 默认的主配置文件  /etc/named.conf(须手动建立该文件)。

四.软件的配置。
1        BIND比较重要的配置文件有:named.conf,named.root,rndc.conf,还有/ etc/named目录。
2        下面逐步分析一个比较基础的配置文件named.conf:(注:named配置文件采用和c语言相同的注释符号程序能否正常运行,全靠这个文件)。
(1) log options
/*
* log option
*/
logging {
channel default_syslog { syslog local2; severity error; };
channel audit_log { file "C:/windows/system32/dns/log/named.log"; severity error; print-time yes; };
/*手动建立该目录和文件,并修改该路径,注意2000 里路径的符号和unix下路径的写法不同,以后程序中如果读取文件,都要注意路径的写法。*/
category default { default_syslog; };
category general { default_syslog; };
category security { audit_log; default_syslog; };
category config { default_syslog; };
category resolver { audit_log; };
category xfer-in { audit_log; };
category xfer-out { audit_log; };
category notify { audit_log; };
category client { audit_log; };
category network { audit_log; };
category update { audit_log; };
category queries { audit_log; };
category lame-servers { audit_log; };
};


这一部分是日志的设置,其中最主要的是

file "C:/windows/system32/dns/log/named.log"; 这一句指定了日志文件的位置,要正常启动named,必须要保证这一文件是存在的,并且named 进程对它有读写权限。

(2) options

options {
directory “C:/windows/system32/dns/etc/named";
/* 注意写法 修改该路径
listen-on-v6 { any; };

// If you've got a DNS server around at your upstream provider, enter
// its IP address here, and enable the line below.  This will make you
// benefit from its cache, thus reduce overall DNS traffic in the Internet.

forwarders {
your.upper.DNS.address;
};

/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below.  Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;

/*
* If running in a sandbox, you may have to specify a different
* location for the dumpfile.
*/
dump-file "/etc/named_dump.db";
};


这一部分是一些基本的配置项:

directory "C:/windows/system32/dns/etc/named"; 指定域名解析等文件的存放目录(须手动建立);

listen-on-v6 { any; }; 支持ipv6的请求;
forwarders {
your.upper.DNS.address;
}; 指定前向DNS,当本机无法解析的域名,就会被转发至前向DNS进行解析。


(3) 线索域和回环域

zone "." {
type hint;
file "named.root";
};

zone "0.0.127.IN-ADDR.ARPA" {
type master;
file "localhost.rev";
};


指定线索域和本地回环域,这一部分使用一些标准的例子就可以。

file "named.root"; 指定该域的解析文件,其目录为options中directory "C:/windows/system32/dns/etc/named";指定的。在本例中为C:/windows/system32/dns/etc/namd。

4)自定义域


zone "test.com" {
type master;
file "zone.test ";
};

zone "0.168.192.in-addr.arpa" {
type master;
file "zone.test.rev";
};
zone "4.0.0.f.0.5.2.0.1.0.0.2.IP6.ARPA" {
type master;
allow-transfer { any;};
        allow-query { any; };
file "ipv6.rev";
};

zone "lowerlevelzone.test.com" {
type slave;
masters {
192.168.1.1;
};
};

这一部分是配置文件中我们需要重点关心的部分:

zone "test.com" {
type master;
file "zone.test ";
}; 设定test.com域;
type master 指明该域主要由本机解析;
file "zone.test "指定其解析文件为zong.test,目录为options中设定的目录本例中为/etc/named。

zone "0.168.192.in-addr.arpa" {
type master;
file "zone. test.rev";
}; 指定ipv4地址逆向解析

type slave 指明该域主要由低一级的域名服务器解析;
masters {
192.168.1.1;
};

// 指定低一级的域名服务器ip地址。

到此我们就初步建立了一个标准的named 的主配置文件,接下来建立对应的域名解析或逆向解析文件。



3        域名解析和IP地址逆向解析文件:/etc/namedb/zone.test

配置文件的格式大致如下


; From: @(#)localhost.rev 5.1 (Berkeley) 6/30/90
; $FreeBSD: src/etc/namedb/PROTO.localhost.rev,v 1.6 2000/01/10 15:31:40 peter Exp $
;
; This file is automatically edited by the `make-localhost' script in
; the /etc/namedb directory.
;
@ IN SOA ns.test.com. root.test.com.(
2005030116; Serial
3600 ; Refresh
900 ; Retry
3600000 ; Expire
3600 ) ; Minimum
 IN NS ns.test.com.

ns IN A 192.168.0.1
www6 IN AAAA 2001:250:f004::10
www IN A 192.168.0.2

本文件前半部分是一些默认的参数设置,只需把域名改成对应得你要设置的域就行,其余的不用过分深究..几个参数稍做解释。

几个需要注意的地方
IN NS ns.test.com;
这一条必须有,来指定本域的域名服务器 ;
域名必须以"."结尾。)
本文件的第二部分(倒数三行),指定了该域上的主机:
ns IN  A 192.168.0.1
ns 为主机名,A 代表地址类型为IPV4地址,192.168.0.1 是实际ip地址,这一条记录的含义是ns.test.com 的ip地址为 192.168.0.1
www6 IN AAAA 2001:250:f004::10
www6 为主机名,AAAA代表地址类型为IPV6地址,2001:250:f004::10 是其IPV6地址,这条记录的含义是www6.test.com 的ip地址是2001:250:f004::10 。


2)IP地址逆向解析:

ipv4 逆向解析:    etc/namedb/zone.test.rev


; From: @(#)localhost.rev 5.1 (Berkeley) 6/30/90
; $FreeBSD: src/etc/namedb/PROTO.localhost.rev,v 1.6 2000/01/10 15:31:40 peter Exp $
;
; This file is automatically edited by the `make-localhost' script in
; the /etc/namedb directory.
;
@ IN SOA ns.test.com. root.test.com.(
2005030116; Serial
3600 ; Refresh
900 ; Retry
3600000 ; Expire
3600 ) ; Minimum
IN NS ns.test.com
;

1 IN PTR ns.test.com.
2 IN PTR  www.test.com./


五  几个配置文件到此基本配置完成,成功了一半,接下来通过cmd 进入bin 的目录
运行
1        运行  rndc-confgen –a  生成一个 rndc.key 为什么这么做请看下面这段话,这是BIND安装文件的说明。

which will create a rndc.key file in the dns/etc directory. This will allow you to run rndc without an explicit rndc.conf file or key and  control entry in named.conf file. See section 3.4.1.2 of the ARM for   details of this. An rndc.conf can also be generated by running:

2  运行 rndc-confgen >; rndc.conf

然后你会发现,当前目录有一个rndc.conf的密钥文件了,呵呵,如果你想看一下内容,也可以使用UltraEdit 打开它,该文件内容大致如下:


# Start of rndc.conf
key "rndc-key" {
        algorithm hmac-md5;
        secret "o2iuzvKIljrrxw7A4cJITQ==";
};

options {
        default-key "rndc-key";
        default-server 127.0.0.1;
        default-port 953;
};
# End of rndc.conf

# Use with the following in named.conf, adjusting the allow list as needed:
# key "rndc-key" {
#         algorithm hmac-md5;
#         secret "o2iuzvKIljrrxw7A4cJITQ==";
# };
#
# controls {
#         inet 127.0.0.1 port 953
#                 allow { 127.0.0.1; } keys { "rndc-key"; };
# };
# End of named.conf


注意,请把后面以:

# Use with the following in named.conf, adjusting the allow list as needed:

开始的这一部份,加到named.conf后面并去掉#才可以,否则后面的rndc status将显示超时退出...


六  测试
嗯,到此为止,好象BIND 9就可以顺利运行了,请按下面的步骤测试吧

进入dos 进入到 bin 目录
named -g
,-g选项表示前台运行,并将调试信息打印到标准输出,这在我们安装调试阶段是非常有帮助的。

当你有看到running字样时,说明已经配置正确了,如果要控制BIND 9的运行,更方便的使用rndc命令来进行,

再开一个dos 窗口,进入到bin 目录  运行
  rndc status
当显示如下信息时,可能会显示如下信息…

number of zones: 5
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
server is up and running

如果看见了 恭喜你 呵呵  ,终于正常配置成功 。如果没有显示上面的信息,请检查你的named.conf文件里面是否配置了rndc.conf里面的key。

至此为止,一般可以实际运作的BIND 9就建立起来了,您可以rndc rolead一下,让最新的设置及软件生效。
如果在安装过程中出现错误,您可以先检查完错误,再接着安装下去。或者你可以选择你感兴趣的某些部份安装!

附 named.root

;       initialize cache of Internet domain name servers
;       (e.g. reference this file in the "cache  .  <file>;"
;       configuration file of BIND domain name servers).
;
;       This file is made available by InterNIC
;       under anonymous FTP as
;           file                /domain/named.root
;           on server           FTP.INTERNIC.NET
;
;       last update:    Nov 5, 2002
;       related version of root zone:   2002110501
;
;
; formerly NS.INTERNIC.NET
;
.                        3600000  IN  NS    A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET.      3600000      A     198.41.0.4
;
; formerly NS1.ISI.EDU
;
.                        3600000      NS    B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET.      3600000      A     128.9.0.107
;
; formerly C.PSI.NET
;
.                        3600000      NS    C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET.      3600000      A     192.33.4.12
;
; formerly TERP.UMD.EDU
;
.                        3600000      NS    D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET.      3600000      A     128.8.10.90
;
; formerly NS.NASA.GOV
;
.                        3600000      NS    E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET.      3600000      A     192.203.230.10
;
; formerly NS.ISC.ORG
;
.                        3600000      NS    F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET.      3600000      A     192.5.5.241
;
; formerly NS.NIC.DDN.MIL
;
.                        3600000      NS    G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET.      3600000      A     192.112.36.4
;
; formerly AOS.ARL.ARMY.MIL
;
.                        3600000      NS    H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET.      3600000      A     128.63.2.53
;
; formerly NIC.NORDU.NET
;
.                        3600000      NS    I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET.      3600000      A     192.36.148.17
;
; operated by VeriSign, Inc.
;
.                        3600000      NS    J.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET.      3600000      A     192.58.128.30
;
; housed in LINX, operated by RIPE NCC
;
.                        3600000      NS    K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET.      3600000      A     193.0.14.129
;
; operated by IANA
;
.                        3600000      NS    L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET.      3600000      A     198.32.64.12
;
; housed in Japan, operated by WIDE
;
.                        3600000      NS    M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET.      3600000      A     202.12.27.33
; End of File

BIND9.12.0.x64 from windows DNS服务器搭建的bind安装包,适用于windows操作系统安装,官方版。 立即下载

相关推荐

DIG-BIND9.17.15.x64-for Windows

dig 是一个 Linux 下用来 DNS 查询信息的工具,全称是Domain Information Groper,与 nslookup 类似,但比 nslookup 功能更强大。Windows 下只有 nslookup,如果也想用到 dig 命令,就只能自己动手安装了。此为适用于Windows平台的dig工具。

Windows10安装bind

1、登录bind网站ftp://ftp.isc.org/isc/ 2、点击这个 3、 4、下载成功之后,安装这个 5、必须以管理员权限运行 6、勾选这个就行,切记上面的安装目录!!!!!!!!;安装完成之后把目录写到系统环境变量中path中;添加的时候注意分号 ; ...

weixin_41092795的博客 3634

windows搭建个人dns服务器——bind9

国内dns环境大家都懂的,自己搞一个也是不错的! PS:该工具为windows 64位版本,里面含有dig工具!

BIND9.8_for_windows

年后单位网络升级,部分网站需要做智能解析,windows自带DNS无法满足需求,决定采用业界评价最高的BIND9做DNS智能解析。以前没有接触过bind,不过对它可也不陌生,毕竟大名鼎鼎嘛!上网搜了2篇文章 一篇是讲基础的http://blogold.chinaunix.net/u/9951/showart_280949.html 另一篇是...

weixin_33910385的博客 626

【Docker】如何让docker容器正常使用nvidia显卡

描述了如何在docker容器中使用英伟达显卡的过程和问题解决方法。

NameLoadingFailed的博客 8372

SAP-ABAP:SAP中如何查看系统表之间的关联关系?

在业务逻辑开发或者ALV开发过程中,我们通常要从系统中找出几个标准表之间的关联关系,有的是head与item,通过外键进行关联的关系。那么怎么去找到呢?以上就是具体如何产看系统表之间的关联关系的步骤,对于不同代码的业务顾问,也是必须要掌握的。

LinkStar的博客 2430

Bind服务的安装和配置(1)

搭建DNS服务器 前提知识 1、什么是DNS及其作用? 2、域名空间结构? 3、域名解析过程? 前提解答 1、DNS(Domain Name System,域名系统),因特网上作为域名和IP地址相互映射的一个分布式数据库,能够使用户更方便的访问互联网,而不用去记住能够被机器直接读取的IP数串。通过主机名,最终得到该主机名对应的IP地址的过程叫做域名解析(或主机名解析)。 2、域名...

Neo Technology Space 3482

Calibre电子书阅读器个性化样式定制指南

本文详细介绍了如何通过Calibre电子书阅读器的用户样式表功能进行深度个性化样式定制。从修改全局字体、行距、背景配色(包括深色/浅色模式)到美化代码块、引用等特殊元素,本指南提供了完整的CSS代码示例与实战技巧,帮助用户打造专属的舒适阅读环境,显著提升电子书阅读体验。

vv45678的博客 920

在Win2003中安装bind【部署智能DNS】

在Win2003中安装bind 部署智能DNS 前言: 搞LINUX的朋友都知道,bind是linux下的DNS服务软件,但很多人不清楚,它也可以运行在windows系统中,windows系统自带的dns,功能弱,是不能作智能DNS解析的,在windows 2008 R2版也没有解决这个问题,有些公司技术力量薄弱一些,一直在用windows系统,所以本文...

weixin_33951761的博客 217

别再傻傻分不清了!一文搞懂电机里的‘旋变’和‘编码器’到底有啥区别

本文深度解析电机位置传感器中旋转变压器(旋变)与编码器的核心区别,包括工作原理、精度对比及环境适应性。通过实测数据和典型应用场景,帮助工程师在工业机器人、新能源汽车电机等关键领域做出精准选型决策,提升系统可靠性和控制精度。

weixin_28689507的博客 502

OPC DCOM详细配置方法 - 不关防火墙不换登陆用户

1. 前言   OPC DCOM的设置是实现跨网络OPC通信的基础,现有的一些OPC DCOM配置教程虽然讲解了如何配置DCOM,但没有讲清楚为什么要这么做,而且各个教程涉及的配置方法也不尽相同。   为了彻底搞清楚OPC DCOM的配置过程,我重新做了两台机器的系统,一台是Windows 7 32位,一台是Windows 10 64位,并且重零开始完整的测试了正常运行OPC DCOM所需的最少的...

steventian72的博客 3万+

在Win2003中安装bind

前言: 搞LINUX的朋友都知道,bind是linux下的DNS服务软件,但很多人不清楚,它也可以运行在windows系统中,windows系统自带的dns,功能弱,是不能作智能DNS解析的,在windows 2008 R2版也没有解决这个问题,有些公司技术力量薄弱一些,一直在用windows系统,所以本文从windows出发,安装bind,利用它的view功能,做智能DN...

weixin_34401479的博客 333

AM243x多核MCU启动流程解析与OSPI Flash烧录实战

嵌入式系统开发中,引导加载器是芯片上电后执行的第一段软件,负责初始化硬件、加载操作系统或应用程序。其工作原理通常遵循多级引导链,从ROM固件到用户可定制的二级引导程序,逐级建立完整的软件运行环境。这一机制的技术价值在于实现可靠的系统启动、支持安全校验,并为多核异构架构提供协同基础。在应用场景上,引导加载器广泛应用于工业控制、汽车电子和物联网设备,确保设备能从非易失性存储器中自主启动。本文聚焦于TI AM243x这类高性能多核MCU,深入剖析其包含RBL和SBL在内的三级启动流程,并详细演示如何通过UART接

weixin_28703451的博客 582

win7、win10、win11、Linux下安装docker

win7 环境安装docker win10 环境安装docker

fendouweiqian的博客 1万+

Visionpro 使用CogPMAlignTool工具提取匹配轮廓点

【代码】Visionpro 使用CogPMAlignTool工具提取匹配轮廓点。

weixin_43947315的博客 2091

深入理解 Terraform 中的资源更新与管理

摘要:本文探讨Terraform处理AWS安全组名称变更时的行为。当修改不可变属性(如安全组名称)时,Terraform会创建新资源并删除旧资源。通过状态文件比对所需状态与实际状态,Terraform对不可变属性采用"先创建后删除"策略,对可变属性则直接更新。实例演示了修改安全组名称和关联EC2实例时的处理过程,强调理解资源属性可变性对基础设施管理的重要性。(149字)

2501_90323865的博客 471

bind9 dns智能解析 for windows 2003 master/slave dns配置

在网上搜索好多关于bind9 智能解析 for win2003的资料,大部分都是做的一个dns服务器,没有找到master/slave配置的文章,于是按照linux中的配置修改了win2003中相对应的配置文件安装dns方法网上都有了,只给出master/slave配置文件---------------master配置文件cnc.def-------------------zone "

东杰书屋 2340

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

中小团队CI/CD实战:工具链与自动化部署最佳实践

在现代软件工程中,持续集成与持续部署(CI/CD)是提升交付效率的核心技术。通过容器化技术(如Docker)确保环境一致性,结合自动化测试框架(如Pytest+Allure)验证代码质量,最终依托Kubernetes实现安全可靠的滚动更新。这种技术组合特别适合中小型团队,能显著降低部署失败率并提升交付速度。典型应用场景包括微服务架构下的快速迭代、多环境配置管理以及生产环境监控(如Prometheus+EFK方案)。实战中需特别注意工具链版本锁定、依赖隔离等工程细节,这正是本文基于300+次真实部署验证的经验

weixin_34005042的博客 392

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

WindowsXP下利用bind9配置DNS服务器

<br /><br />这两天为了在局域网内配置DNS服务器花了一番功夫,最终搞定了。简单整理一下步骤和遇到的问题<br />1.在https://www.isc.org/software/bind下载bind9, 我使用的版本是BIND 9.6.0-P1 for Windows XP/2003/2008<br />2.解压缩,运行BINDInstall.exe,不要勾选“Start Bind Service After Install”,Service Account Name和Password一定要输入

晨风茶馆 4752

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

MySQL 8.0 远程连接 2003 错误:4步诊断与修复,含防火墙与安全组配置

本文详细解析MySQL 8.0远程连接报错2003的完整解决方案,涵盖服务状态检查、配置文件调整、用户权限设置及防火墙/安全组配置四步诊断法,特别针对云服务器环境提供全链路修复指南,帮助开发者快速解决10061连接错误问题。

weixin_34194359的博客 436

WIN2003下 智能DNS系统架设

1、什么是智能域名服务器,有什么用? 简单的说,就是域名服务器能够按照请求用户的网络地址范围,做出不同的地址解析。 智能域名服务器在中国的主要作用是解决中国电信和中国网通间存在的问题 — 当你设置一个服务器在电信的网络上,这个时候网通的用户访问往往很慢,而如果设置在网通则电信访问很慢,要解决这个问题有很多方法,比较容易采用的是:在电信和网通都设置服务器,而后让用户使用不同的域名访问,如电信...

悠悠猪 124
下一篇: Window2003下Apache2.0.55+Tomcat5.5.16+PHP5.1.2的安装整合
webmelon
博客等级 码龄24年 0粉丝 17原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值