最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

ansible部署DNS緩存服務(wù)器的實(shí)現(xiàn)步驟

 更新時(shí)間:2023年08月06日 15:05:34   作者:明明星空  
本文主要介紹了ansible部署DNS緩存服務(wù)器的實(shí)現(xiàn)步驟,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧

DNS緩存服務(wù)器是一種不負(fù)責(zé)域名數(shù)據(jù)維護(hù)的DNS服務(wù)器。簡(jiǎn)單來說,緩存服務(wù)器就是把用戶經(jīng)常使用到的域名與IP地址的解析記錄保存在主機(jī)本地,從而提升下次解析的效率,這次使用unbound這款軟件部署緩存服務(wù)器

一、 準(zhǔn)備工作

1、 實(shí)驗(yàn)拓?fù)?/h3>

節(jié)點(diǎn)IP地址說明
DNS-server192.168.0.100緩存服務(wù)器
centos2192.168.0.101客戶端

2、 unbound軟件介紹

Unbound是紅帽公司(RedHat)默認(rèn)使用的的DNS服務(wù)包,Unbound是一個(gè)安全性高、功能強(qiáng)大、配置簡(jiǎn)單。

3、 使用參數(shù)說明

參數(shù)說明
interface監(jiān)聽ip
interface-automatic如果部署在非默認(rèn)端口上,例如80/443,則需要禁用此選項(xiàng)
access-control允許網(wǎng)段
forward-zone允許域名,從哪里緩存

二、 ansible文件

1、 目錄結(jié)構(gòu)

[root@mmx_ansible dns_automating_unbound]# ls
ansible.cfg  inventory.yml  server.conf.j2  unbound.conf  unbound.yml

2、 配置文件

ansible.cfg

[defaults]
inventory=./inventory.yml
remote_user=root

3、主機(jī)清單文件

inventory.yml

home:
    caching_dns:
      ansible_host: 192.168.0.100
      ansible_ssh_password: "密碼"
      ansible_user: "用戶名"

4、 模板文件

server.conf.j2

{# 通過列舉出所有的ipv4地址,來寫 #}
server:
{% for ip in ansible_facts['all_ipv4_addresses'] %}
? ? interface: {{ ip }}
{% endfor %}
? ? interface-automatic: no
? ? access-control: {{ access_control }}
? ? domain-insecure: {{ domain_insecure }}
forward-zone:
? ? name: "{{ forward_zone_name }}"
? ? forward-addr: {{ forward_addr }}

5、 playbook

unbound.yml

---
- name: ubound is deployed on caching nameservers
? hosts: caching_dns
? become: yes
? vars:
? ? forward_addr: "114.114.114.114"
? ? access_control: "0.0.0.0/0 allow"
? ? domain_insecure: "*"
? ? forward_zone_name: "."
? tasks:
? ? - name: unbound is installed(安裝軟件包)
? ? ? yum:
? ? ? ? name: unbound
? ? ? ? state: present
? ? - name: unbound configuration is correct(配置unbound文件,當(dāng)修改該文件時(shí),重啟服務(wù))
? ? ? template:
? ? ? ? src: server.conf.j2
? ? ? ? dest: /etc/unbound/conf.d/server.conf
? ? ? ? owner: root
? ? ? ? group: unbound
? ? ? ? mode: '0644'
? ? ? ? setype: named_conf_t
? ? ? notify:
? ? ? ? - restart unbound
? ? - name: unbound is started and enabled(開啟&&開機(jī)啟動(dòng)unbound服務(wù))
? ? ? service:
? ? ? ? name: unbound
? ? ? ? state: started
? ? ? ? enabled: yes
? ? - name: unbound is started and enabled(確保防火墻開啟)
? ? ? service:
? ? ? ? name: firewalld
? ? ? ? state: started
? ? ? ? enabled: yes
? ? - name: dns is enabled on the firewalld(放行unbound服務(wù))
? ? ? ansible.posix.firewalld:
? ? ? ? service: dns
? ? ? ? state: enabled
? ? ? ? permanent: yes
? ? ? ? immediate: yes
? handlers:
? ? ? # 重啟unbound服務(wù)
? ? - name: restart unbound
? ? ? service:
? ? ? ? name: unbound
? ? ? ? state: restarted

6、 執(zhí)行playbook

ansible-playbook unbound.yml

[root@mmx_ansible dns_automating_unbound]# ansible-playbook unbound.yml?
PLAY [ubound is deployed on caching nameservers] *************************************************************************************************************************************************************************************************
TASK [Gathering Facts] ***************************************************************************************************************************************************************************************************************************
ok: [caching_dns]
TASK [unbound is installed(安裝軟件包)] **********************************************************************************************************************************************************************************************************
ok: [caching_dns]
TASK [unbound configuration is correct(配置unbound文件,當(dāng)修改該文件時(shí),重啟服務(wù))] ***************************************************************************************************************************************************************
ok: [caching_dns]
TASK [unbound is started and enabled(開啟&&開機(jī)啟動(dòng)unbound服務(wù))] *********************************************************************************************************************************************************************************
ok: [caching_dns]
TASK [unbound is started and enabled(開啟&&開機(jī)啟動(dòng)unbound服務(wù))] *********************************************************************************************************************************************************************************
ok: [caching_dns]
TASK [dns is enabled on the firewalld(放行unbound服務(wù))] ******************************************************************************************************************************************************************************************
ok: [caching_dns]
PLAY RECAP ***************************************************************************************************************************************************************************************************************************************
caching_dns ? ? ? ? ? ? ? ?: ok=6 ? ?changed=0 ? ?unreachable=0 ? ?failed=0 ? ?skipped=0 ? ?rescued=0 ? ?ignored=0

三、測(cè)試

1、 客戶端

1) 臨時(shí)修改客戶端DNS地址

[root@dns_client ~]# vim /etc/resolv.conf
nameserver 192.168.0.100

2) nslookup訪問百度

[root@dns_client ~]# nslookup www.baidu.com
Server: ? ? ? ? 192.168.0.100
Address: ? ? ? ?192.168.0.100#53
Non-authoritative answer:
www.baidu.com ? canonical name = www.a.shifen.com.
Name: ? www.a.shifen.com
Address: 182.61.200.7
Name: ? www.a.shifen.com
Address: 182.61.200.6

2、 緩存服務(wù)器

1 ) 查看修改的配置文件

[root@DNS-Server_ubound ~]# cat /etc/unbound/conf.d/server.conf
server:
? ? interface: 192.168.0.100
? ? interface-automatic: no
? ? access-control: 0.0.0.0/0 allow
? ? domain-insecure: *
forward-zone:
? ? name: "."
? ? forward-addr: 114.114.114.114

2)查看緩存

unbound-control dump_cache

[root@DNS-Server_ubound ~]# unbound-control dump_cache
START_RRSET_CACHE
;rrset 155 1 0 2 3
a.shifen.com.   155     IN      SOA     ns1.a.shifen.com. baidu_dns_master.baidu.com. 2301200016 5 5 2592000 3600
;rrset 125 2 0 5 3
www.a.shifen.com.       125     IN      A       182.61.200.6
www.a.shifen.com.       125     IN      A       182.61.200.7
;rrset 545 1 0 5 3
www.baidu.com.  545     IN      CNAME   www.a.shifen.com.
END_RRSET_CACHE
START_MSG_CACHE
msg www.a.shifen.com. IN AAAA 33152 1 155 3 0 1 0
a.shifen.com. IN SOA 4
msg www.baidu.com. IN A 33152 1 125 3 2 0 0
www.baidu.com. IN CNAME 0
www.a.shifen.com. IN A 0
msg www.a.shifen.com. IN A 33152 1 125 0 1 0 0
www.a.shifen.com. IN A 0
END_MSG_CACHE
EOF

到此這篇關(guān)于ansible部署DNS緩存服務(wù)器的實(shí)現(xiàn)步驟的文章就介紹到這了,更多相關(guān)ansible部署DNS緩存服務(wù)器內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Windows?Server?2019?安裝架設(shè)DNS服務(wù)器

    Windows?Server?2019?安裝架設(shè)DNS服務(wù)器

    這篇文章主要介紹了Windows?Server?2019?DNS服務(wù)器的配置與管理之安裝DNS服務(wù),需要的朋友可以參考下
    2023-05-05
  • ansible部署DNS緩存服務(wù)器的實(shí)現(xiàn)步驟

    ansible部署DNS緩存服務(wù)器的實(shí)現(xiàn)步驟

    本文主要介紹了ansible部署DNS緩存服務(wù)器的實(shí)現(xiàn)步驟,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2023-08-08
  • DNS服務(wù)器 支持泛域名解析的設(shè)置方法 [修正版本]

    DNS服務(wù)器 支持泛域名解析的設(shè)置方法 [修正版本]

    很多企業(yè)都架設(shè)了多個(gè)Web站點(diǎn)來滿足員工的工作需要,為了節(jié)省費(fèi)用,這些網(wǎng)站通常采用虛擬主機(jī)技術(shù),即在同一個(gè)服務(wù)器上架設(shè)多個(gè)網(wǎng)站,員工使用二級(jí)域名訪問這些站點(diǎn)。
    2009-06-06
  • 使用Unbound配置DNS緩存服務(wù)器的實(shí)現(xiàn)步驟

    使用Unbound配置DNS緩存服務(wù)器的實(shí)現(xiàn)步驟

    本文主要介紹了使用Unbound配置DNS緩存服務(wù)器的實(shí)現(xiàn)步驟,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2023-08-08
  • Windows?Server?2019?DNS服務(wù)器的配置與管理之DNS正向解析

    Windows?Server?2019?DNS服務(wù)器的配置與管理之DNS正向解析

    這篇文章主要介紹了Windows?Server?2019?DNS服務(wù)器的配置與管理之DNS正向解析,需要的朋友可以參考下
    2023-05-05
  • DNS原理及其解析過程剖析(圖文)

    DNS原理及其解析過程剖析(圖文)

    我們無法記住10個(gè)以上IP地址的網(wǎng)站,所以我們?cè)L問網(wǎng)站時(shí),更多的是在瀏覽器地址欄中輸入域名,就能看到所需要的頁面,這是因?yàn)橛幸粋€(gè)叫DNS服務(wù)器的計(jì)算機(jī)自動(dòng)把我們的域名翻譯成了相應(yīng)的IP地址,然后調(diào)出IP地址所對(duì)應(yīng)的網(wǎng)頁
    2012-09-09
  • DNS服務(wù)器中創(chuàng)建正向查找區(qū)域并在該區(qū)域下創(chuàng)建主機(jī)記錄

    DNS服務(wù)器中創(chuàng)建正向查找區(qū)域并在該區(qū)域下創(chuàng)建主機(jī)記錄

    創(chuàng)建正向查找區(qū)域ynkm.com,并在該區(qū)域下創(chuàng)建主機(jī)記錄Webserver,ynkm.com,具體操作步驟如下,需要的朋友可以了解下
    2013-12-12
  • DNS服務(wù)器未響應(yīng)的原因及解決方法

    DNS服務(wù)器未響應(yīng)的原因及解決方法

    DNS是進(jìn)行域名和與之相對(duì)應(yīng)的IP地址轉(zhuǎn)換的服務(wù)器,本文主要介紹了DNS服務(wù)器未響應(yīng)的原因及解決方法,具有一定的參考價(jià)值,感興趣的可以了解一下
    2023-10-10
  • winmydns DNS服務(wù)器架設(shè)

    winmydns DNS服務(wù)器架設(shè)

    winmydns 一款dns服務(wù)器架設(shè)軟件,大家可以參考下配置,自己的dns服務(wù)器。
    2009-06-06
  • 深入理解DNSlog

    深入理解DNSlog

    本文主要介紹了深入理解DNSlog,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2023-05-05

最新評(píng)論

西充县| 新建县| 沾化县| 新化县| 富宁县| 邢台市| 原平市| 邵东县| 文山县| 云林县| 永城市| 浪卡子县| 安龙县| 林芝县| 宜黄县| 长兴县| 潜江市| 肥东县| 赤峰市| 新绛县| 合水县| 民勤县| 安康市| 天峨县| 廉江市| 广宁县| 威宁| 山阳县| 积石山| 瑞昌市| 乌恰县| 兴安县| 张北县| 天等县| 子洲县| 哈尔滨市| 阳高县| 和平县| 金堂县| 鸡泽县| 佛教|