使用BIND安装智能DNS服务器(一)---基本的主从DNS服务器搭建

参考网址:http://www.unixmen.com/dns-server-installation-step-by-step-using-centos-6-3/  

DNS(Domain Name System) 将主机名或者URLS翻译成IP地址。

例如:如果在浏览器输入网址 "www.unixmen.com" 

DNS server 将把这个域名翻译成和他关联的IP地址。

就是说:DNS servers 用于将类似 www.unixmen.com 这样的名称 翻译成 173.xxx.xxx.xxx 这样是为了方便人们记住域名,而不是IP地址。

方案

主(primary/master) DNS Server
环境配置:

操作系统 : CentOS 6.5 server
主机名 : masterdns.unixmen.local
IP地址 : 192.168.1.100/24

 

从(secondary/slave) DNS Server
环境配置:

操作系统 : CentOS 6.5 server
主机名 : secondarydns.unixmen.local
IP地址 : 192.168.1.101/24

 

客户端环境:

操作系统 : CentOS 6.5 Desktop 
主机名 : Client.unixmen.local
IP地址 : 192.168.1.102/24

 

安装主(primary/master) DNS Server
[root@masterdns ~]# yum install bind* -y
1.配置DNS Server
添加如下所示行到/etc/named.conf文件中
[root@masterdns ~]# vi /etc/named.conf

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
listen-on port 53 { 127.0.0.1; 192.168.1.100; }; ### 主DNS 的 IP地址 ###
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { localhost; 192.168.1.0/24; }; ### 允许访问网络的IP范围 ,末尾的 /24 是网络掩码的缩写表示(在本例中为 255.255.255.0)### 
allow-transfer{ localhost; 192.168.1.101; }; ### 从 DNS IP ###
recursion yes;   ###是否允许递归,有建议说应设置为no,为了是防止DDOS攻击###
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};//自定义的正向和反向解析
zone"unixmen.local" IN {
type master;
file "forward.unixmen"; //正向解析文件名
allow-update { none; };
};
zone"1.168.192.in-addr.arpa" IN {
type master;
file "reverse.unixmen";//反向解析文件名
allow-update { none; };
};include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

 

2.创建zone文件
以下文件已经在/etc/named.conf中定义

2.1 创建正向Zone
创建forward.unixmen 文件在 /var/named 目录下
[root@masterdns ~]# vi /var/named/forward.unixmen

$TTL 86400
@ IN SOA masterdns.unixmen.local. root.unixmen.local. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS masterdns.unixmen.local.
@ IN NS secondarydns.unixmen.local.
@ IN A 192.168.1.100
@ IN A 192.168.1.101
@ IN A 192.168.1.102
masterdns IN A 192.168.1.100
secondarydns IN A 192.168.1.101
client IN A 192.168.1.102

 

2.2创建反向Zone
创建reverse.unixmen 文件在 /var/named 目录下
[root@masterdns ~]# vi /var/named/reverse.unixmen

$TTL 86400
@ IN SOA masterdns.unixmen.local. root.unixmen.local. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS masterdns.unixmen.local.
@ IN NS secondarydns.unixmen.local.
@ IN PTR unixmen.local.
masterdns IN A 192.168.1.100
secondarydns IN A 192.168.1.101
client IN A 192.168.1.102
100 IN PTR masterdns.unixmen.local.
101 IN PTR secondarydns.unixmen.local.
102 IN PTR client.unixmen.local.

 

3.启动DNS服务
[root@masterdns ~]# service named start
Starting named: [ OK ]
[root@masterdns ~]# chkconfig named on

4.调整防火墙允许DNS Server 访问外部网络
添加以下内容到 /etc/sysconfig/iptables 文件中
[root@masterdns ~]# vi /etc/sysconfig/iptables

# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]#添加DNS Server
-A INPUT -p udp -m state --state NEW --dport 53 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 53 -j ACCEPT-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

 

5.重启防火墙
[root@masterdns ~]# service iptables restart

iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
iptables: Applying firewall rules: [ OK ]

 

6.设置当前的DNS服务器
添加以下内容到 /etc/resolv.conf 文件中
[root@masterdns ~]# vim /etc/resolv.conf
nameserver 192.168.1.131

7.测试DNS配置和zone文件是否有语法错误
[root@masterdns ~]# named-checkconf /etc/named.conf
[root@masterdns ~]# named-checkzone unixmen.local /var/named/forward.unixmen
zone unixmen.local/IN: loaded serial 2011071001
OK
[root@masterdns ~]# named-checkzone unixmen.local /var/named/reverse.unixmen
zone unixmen.local/IN: loaded serial 2011071001
OK

8.测试DNS Server
[root@masterdns ~]# dig masterdns.unixmen.local

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6 <<>> masterdns.unixmen.local
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49834
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
;; QUESTION SECTION:
;masterdns.unixmen.local.INA
;; ANSWER SECTION:
masterdns.unixmen.local. 86400INA192.168.1.100
;; AUTHORITY SECTION:
unixmen.local.86400INNSsecondarydns.unixmen.local.
unixmen.local.86400INNSmasterdns.unixmen.local.
;; ADDITIONAL SECTION:
secondarydns.unixmen.local. 86400 INA192.168.1.101
;; Query time: 6 msec
;; SERVER: 192.168.1.100#53(192.168.1.100)
;; WHEN: Thu Mar 7 13:07:56 2013
;; MSG SIZE rcvd: 114

 


[root@masterdns ~]# nslookup unixmen.local

Server:192.168.1.100
Address:192.168.1.100#53
Name:unixmen.local
Address: 192.168.1.102
Name:unixmen.local
Address: 192.168.1.100
Name:unixmen.local
Address: 192.168.1.101

 

现在主DNS Server 已经可以使用了

 

安装从(Secondary/Slave) DNS Server
[root@secondarydns ~]# yum install bind* -y
1.配置从DNS Server
添加如下所示行到/etc/named.conf文件中
[root@secondarydns ~]# vi /etc/named.conf

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
listen-on port 53 { 127.0.0.1; 192.168.1.101; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { localhost; 192.168.1.0/24; };
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
zone"unixmen.local" IN {
type slave;
file "slaves/unixmen.fwd";
masters { 192.168.1.100; };
};
zone"1.168.192.in-addr.arpa" IN {
type slave;
file "slaves/unixmen.rev";
masters { 192.168.1.100; };
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

 

2.启动DNS服务
[root@secondarydns ~]# service named start
Generating /etc/rndc.key: [ OK ]
Starting named: [ OK ]
[root@secondarydns ~]# chkconfig named on

现在主DNS server上的正向和反向zone文件,被自动复制到了从 DNS Server 的 /var/named/slaves/ 目录下
[root@secondarydns ~]# ls /var/named/slaves/
unixmen.fwd unixmen.rev

[root@secondarydns ~]# cat /var/named/slaves/unixmen.fwd

$ORIGIN .
$TTL 86400; 1 day
unixmen.localIN SOAmasterdns.unixmen.local. root.unixmen.local. (
2011071001 ; serial
3600 ; refresh (1 hour)
1800 ; retry (30 minutes)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
NS masterdns.unixmen.local.
NS secondarydns.unixmen.local.
A192.168.1.100
A192.168.1.101
A192.168.1.102
$ORIGIN unixmen.local.
clientA192.168.1.102
masterdnsA192.168.1.100
secondarydnsA192.168.1.101

[root@secondarydns ~]# cat /var/named/slaves/unixmen.rev 

$ORIGIN .
$TTL 86400; 1 day
1.168.192.in-addr.arpaIN SOAmasterdns.unixmen.local. root.unixmen.local. (
2011071001 ; serial
3600 ; refresh (1 hour)
1800 ; retry (30 minutes)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
NS masterdns.unixmen.local.
NS secondarydns.unixmen.local.
PTRunixmen.local.
$ORIGIN 1.168.192.in-addr.arpa.
100PTRmasterdns.unixmen.local.
101PTRsecondarydns.unixmen.local.
102PTRclient.unixmen.local.
clientA192.168.1.102
masterdnsA192.168.1.100
secondarydnsA192.168.1.101

 

3.添加DNS Server到所有系统中
[root@secondarydns ~]# vi /etc/resolv.conf

# Generated by NetworkManager
search ostechnix.com
nameserver 192.168.1.100
nameserver 192.168.1.101
nameserver 8.8.8.8

 

4.测试DNS Server
[root@secondarydns ~]# dig masterdns.unixmen.local

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6 <<>> masterdns.unixmen.local
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21487
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
;; QUESTION SECTION:
;masterdns.unixmen.local.INA
;; ANSWER SECTION:
masterdns.unixmen.local. 86400INA192.168.1.100
;; AUTHORITY SECTION:
unixmen.local.86400INNSmasterdns.unixmen.local.
unixmen.local.86400INNSsecondarydns.unixmen.local.
;; ADDITIONAL SECTION:
secondarydns.unixmen.local. 86400 INA192.168.1.101
;; Query time: 15 msec
;; SERVER: 192.168.1.100#53(192.168.1.100)
;; WHEN: Thu Mar 7 13:27:57 2013
;; MSG SIZE rcvd: 114

 

[root@secondarydns ~]# dig secondarydns.unixmen.local

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6 <<>> secondarydns.unixmen.local
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20958
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
;; QUESTION SECTION:
;secondarydns.unixmen.local.INA
;; ANSWER SECTION:
secondarydns.unixmen.local. 86400 INA192.168.1.101
;; AUTHORITY SECTION:
unixmen.local.86400INNSmasterdns.unixmen.local.
unixmen.local.86400INNSsecondarydns.unixmen.local.
;; ADDITIONAL SECTION:
masterdns.unixmen.local. 86400INA192.168.1.100
;; Query time: 4 msec
;; SERVER: 192.168.1.100#53(192.168.1.100)
;; WHEN: Thu Mar 7 13:31:53 2013
;; MSG SIZE rcvd: 114[root@secondarydns ~]# nslookup unixmen.local
Server:192.168.1.100
Address:192.168.1.100#53
Name:unixmen.local
Address: 192.168.1.101
Name:unixmen.local
Address: 192.168.1.102
Name:unixmen.local
Address: 192.168.1.100

 

client配置
添加DNS Server到所有客户端的 /etc/resolv.conf 文件中
[root@client unixmen]# vi /etc/resolv.conf
# Generated by NetworkManager
search unixmen.local
nameserver 192.168.1.100
nameserver 192.168.1.101
nameserver 8.8.8.8

测试DNS Server

[root@client unixmen]# dig masterdns.unixmen.local

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6 <<>> masterdns.unixmen.local
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19496
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
;; QUESTION SECTION:
;masterdns.unixmen.local.INA
;; ANSWER SECTION:
masterdns.unixmen.local. 86400INA192.168.1.100
;; AUTHORITY SECTION:
unixmen.local.86400INNSmasterdns.unixmen.local.
unixmen.local.86400INNSsecondarydns.unixmen.local.
;; ADDITIONAL SECTION:
secondarydns.unixmen.local. 86400 INA192.168.1.101
;; Query time: 30 msec
;; SERVER: 192.168.1.100#53(192.168.1.100)
;; WHEN: Thu Mar 7 13:47:55 2013
;; MSG SIZE rcvd: 114

 

[root@client unixmen]# dig secondarydns.unixmen.local

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6 <<>> secondarydns.unixmen.local
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14852
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
;; QUESTION SECTION:
;secondarydns.unixmen.local.INA
;; ANSWER SECTION:
secondarydns.unixmen.local. 86400 INA192.168.1.101
;; AUTHORITY SECTION:
unixmen.local.86400INNSsecondarydns.unixmen.local.
unixmen.local.86400INNSmasterdns.unixmen.local.
;; ADDITIONAL SECTION:
masterdns.unixmen.local. 86400INA192.168.1.100
;; Query time: 8 msec
;; SERVER: 192.168.1.100#53(192.168.1.100)
;; WHEN: Thu Mar 7 13:48:38 2013
;; MSG SIZE rcvd: 114

 


[root@client unixmen]# dig client.unixmen.local

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6 <<>> client.unixmen.local
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14604
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;client.unixmen.local.INA
;; ANSWER SECTION:
client.unixmen.local.86400INA192.168.1.102
;; AUTHORITY SECTION:
unixmen.local.86400INNSmasterdns.unixmen.local.
unixmen.local.86400INNSsecondarydns.unixmen.local.
;; ADDITIONAL SECTION:
masterdns.unixmen.local. 86400INA192.168.1.100
secondarydns.unixmen.local. 86400 INA192.168.1.101
;; Query time: 5 msec
;; SERVER: 192.168.1.100#53(192.168.1.100)
;; WHEN: Thu Mar 7 13:49:11 2013
;; MSG SIZE rcvd: 137

 


[root@client unixmen]# nslookup unixmen.local

Server:192.168.1.100
Address:192.168.1.100#53
Name:unixmen.local
Address: 192.168.1.102
Name:unixmen.local
Address: 192.168.1.100
Name:unixmen.local
Address: 192.168.1.101

 

现在主从DNS Server已经可以使用了

转载于:https://www.cnblogs.com/etangyushan/p/4309014.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/431988.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

openflow交换机 ryu_关于OpenFlow协议

SDN中两个重要元素&#xff1a;控制器(掌控全局&#xff0c;指挥网络内的设备工作)交换机(转发数据)控制器与网络设备通过OpenFlow协议进行通信OpenFlow交换机内有一个FlowTable&#xff0c;交换机按照流表转发数据&#xff0c;流表由控制器生成和维护。内有数据包匹配特征和数…

QT 语言切换

1. 代码里面需要切换语言的文字用tr包裹 2. 在工程pro文件目录下 3. 使用QT安装目录下的 Linguist程序增加中文字符串 4. 打开命令行 5. 执行 lrelease.exe ......\translations\zh_CN.ts

excel条形码字体_在Excel中批量生成条形码,竟如此简单!

条形码可以标出物品的生产国、制造厂家、商品名称、生产日期、图书分类号、邮件起止地点、类别、日期等许多信息&#xff0c;因而在商品流通、图书管理、邮政管理、银行系统等许多领域都得到广泛的应用。那么如何在Excel中快速生成条形码呢&#xff1f;我们以前看到的方法有&am…

(视频) 《快速创建网站》 3.2 WordPress多站点及Azure在线代码编辑器 - 扔掉你的ftp工具吧,修改代码全部云端搞定...

本文是《快速创建网站》系列的第6篇&#xff0c;如果你还没有看过之前的内容&#xff0c;建议你点击以下目录中的章节先阅读其他内容再回到本文。 访问本系列目录&#xff0c;请点击&#xff1a;http://devopshub.cn/tag/wordpress-on-azure/ 1. 网站管理平台WordPress和云计算…

自定义外部协议使浏览器拉起本地程序

什么是自定义协议 由于我们的游戏需要在浏览器中调用NPAPI插件&#xff0c;而chrome移除了NPAPI的支持&#xff0c;导致游戏并不能很好的适配所有的浏览器&#xff0c;所以这个时候我们对于chrome浏览器用到了自定义浏览器协议这一标准。自定义浏览器协议允许在浏览器中使用pr…

hssfcolor 不建议使用_不建议使用微信双开的真正原因!

不少小伙伴都有两个甚至多个微信号&#xff0c;通常一个是自己的私人号&#xff0c;其它则用于工作&#xff0c;所以想要在手机中双开微信&#xff0c;这样使用起来更方便。不过使用 iPhone 的小伙伴就很郁闷了&#xff0c;为什么在 iPhone 上不能像部分安卓手机那样方便的双开…

【转】如何用css限制文字长度,使溢出的内容用省略号…显示

文章转自这里(现在貌似被黑了&#xff0c;建议不要点击了) ps&#xff1a;因在该地方没看到转载按钮&#xff0c;复制下存到这里以待自己方便&#xff0c;别人能看到帮助一下更是乐意之至&#xff0c;效果亲测可以实现&#xff0c;兼容IE、谷歌、火狐 由于文字内容长度的不确定…

yytextview多种格式_iOS YYText的使用笔记一(YYTextView图文编辑器)

YYText是强大的YYKit的一部分可以单独下载Powerful text framework for iOS to display and edit rich text. (Its a component ofYYKit)集成的时候建议使用cocopod管理1.里面主要两个控件&#xff1a;YYTextView 和 YYLabel现在主要是YYTextview的简单使用YYText主要是NSMutab…

React Canvas:高性能渲染 React 组

React Canvas 提供了使用 Canvas 渲染移动 Web App 界面的能力&#xff0c;替代传统的 DOM 渲染&#xff0c;具有更接近 Native App 的使用体验。React Canvas 提供了一组标准的 React 组件&#xff0c;由基于的渲染元素抽象而成。 GitHub 源码下载 示例代码&#xff1a; …

移除集合效率高还是add高_List、set集合接口分析

一、List接口详解1、List接口有三个实现类&#xff0c;ArrayList、LinkedList、Vector2、三个实现类的异同点&#xff1a;&#xff08;1&#xff09;ArrayList: 作为list接口的主要实现类&#xff1b;线程不安全&#xff0c;效率高&#xff1b;底层使用Object[]存储&#xff08…

代码实践

闭包举例&#xff1a; function closure(){var innerVariable inner;function innerFn(){ return innerVariable;}return innerFn(); } var innerVariable defined in outer; var outerVariable closure(); console.log(outerVariable); 测试字符串是否回文&#xff1a; …

python 读取excel太慢_Python 读取excel并转换为字典

方法一&#xff1a;利用利用xlrd读取excel文件其实整个过程比较简单&#xff0c;利用xlrd读取excel文件&#xff0c;再把读取到的数据转换为dict即可。1.安装 xlrdpip install xlrd2.读取文件&#xff0c;并进行格式转换导入的excel表格的格式是这样的&#xff1a;解析后的格式…

windows上编译zlib-1.2.8

MSVC编译 使用VS&#xff08;x86&#xff09;命令行工具进入到zlib根目录&#xff0c;执行 nmake -f win32/Makefile.msc ,在根目录下生成&#xff1a;zlib.lib(静态库) zdll.lib(动态库的导入库) zlib1.dll(动态库) 。必要的头文件有zlib.h和zconf.h 默认生成的是release版的…

大表与大表join数据倾斜_技术分享|大数据技术初探之Spark数据倾斜调优

侯亚南数据技术处支宸啸数据技术处在大数据计算中&#xff0c;我们可能会遇到一个很棘手的问题——数据倾斜&#xff0c;此时spark任务的性能会比预期要差很多&#xff1a;绝大多数task都很快执行完成&#xff0c;但个别task执行极慢或者报OOM(内存溢出)。数据倾斜调优&#xf…

NYOJ 289 苹果(01背包)

苹果 时间限制&#xff1a;3000 ms | 内存限制&#xff1a;65535 KB难度&#xff1a;3描述ctest有n个苹果&#xff0c;要将它放入容量为v的背包。给出第i个苹果的大小和价钱&#xff0c;求出能放入背包的苹果的总价钱最大值。 输入有多组测试数据&#xff0c;每组测试数据第一…

磁盘剩余空间策略_MySQL磁盘消耗迅猛掌握这点就够了,包你事半功倍

Part1:写在最前当一张单表10亿数据量的表放在你面前&#xff0c;你将面临着什么&#xff1f;Part2:背景介绍为了提升数据库资源利用率&#xff0c;一个实例中&#xff0c;在不互相影响&#xff0c;保证业务高效的前提下&#xff0c;我们会将同一个大业务下的不同小业务放在一个…

Date Picker控件:

Date Picker控件&#xff1a; 中文&#xff1a;日期/时间选取器UIDatePicker有一个实例方法setDate:animated&#xff0c;以编程的方式选择日期。UIDatePicker有四种模式&#xff08;model&#xff09;&#xff1a;Time&#xff08;只选时间&#xff09;Date&#xff08;只选日…

logback日志pattern_@Slf4j 实现日志输入到外部文件

添加一个配置文件\src\main\resources\logback-spring.xml<?xml version"1.0" encoding"UTF-8"?><configuration scan"true" scanPeriod"10 seconds"> <contextName>logbackcontextName> <prope…

C++ Prime:sizeof运算符

sizeof运算符的结果部分地依赖于其作用的类型&#xff1a; 对char或者类型为char的表达式执行sizeof运算结果得1&#xff1b; 对引用类型执行sizeof运算得到被引用对象所占空间的大小&#xff1b; 对指针执行sizeof运算得到指针本身所占空间的大小&#xff1b; 对解引用指针执行…

前驱和后驱什么意思_为什么只有豪车才敢用后驱

为什么只有豪车才敢用后驱https://www.zhihu.com/video/1156959599864147968一般的家用车&#xff0c;基本上都是前驱为主&#xff0c;前驱够用&#xff0c;成本还低。但前驱满足不了豪华车的运动需求&#xff0c;所以豪华车后驱才是王道。有人这个时候肯定要跳出来不服了&…