SlideShare a Scribd company logo
1 of 21
How To
Configure BIND as a
Primary DNS Server
on RHEL7 / CentOS7
Author: Hafiz Haider
Website: www.BroExperts.com
Email: admin@broexperts.com
Step by Step Guide By : BroExperts.com
Introduction:
What is DNS?
DNS(Domain NameSystem) is a hierarchical structurethat is responsible for resolving hostnames into theirnumerical IPaddresses
for computer systems and vice versa.
• Domain NameSystemhasbeenused ontheinternet and inthe privatenetworks aswell.
Primary or Master DNS Server
A Primaryor Master DNSserver has authority of its domain and it is maintainerof domain’s original zonedata. Domain zone files are
maintainedon the primary DNSservers and theycan propagate domain’s record to secondary servers.
For More Free Linux Guides Visit: www.broexperts.com
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
Lab Network Details:
Client For DNSTesting
IP: 192.168.199
FQDN: client.broexperts.local
OS: CentOS7.3(Min Install)
Lab Server
Domain: broexperts.local
IP: 192.168.1.114
FQDN: ns1.broexperts.local
OS: CentOS7.3(Min Install)
Our Goal:
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
At the endof this tutorial you will beable to know How
To ConfigureBIND as a DNS Serveron RHEL7, and
finally you will test DNS serverfunctionality over the
network.
BIND Installation& Configuration:
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
Step-1: InstallBIND Package
Installed requiredpackages bind and bind-utils using following yumcommand:
# yum install bind bind-utils -y
Step-2: ZoneEntryin /etc/named.conf file
After installing requiredbind packages, its time to edit main configuration file named.conf, which controls the
behavior and functionality of BIND.
Below i havementioned mymodified /etc/named.conf file with changesas per mynetworkand zone entryof
domain “broexperts.local” as mentioned above in lab server details.
Open /etc/named.conf file
BIND Installation& Configuration:
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
# vi /etc/named.conf
youcan edit your named.conf file as per yourrequirements by following all highlighted changesdone by meas
shown below
options {
listen-on port 53 {192.168.1.114; };
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 { 192.168.1.0/24;};
recursion no;
dnssec-enable yes;
dnssec-validation yes;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
};
BIND Installation& Configuration:
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
###Forward Zone Entry###
zone "broexperts.local" IN {#Domain Name
type master;
file "db.broexperts.local.fwd"; #Forward Zone File Name
allow-update { none; };
};
###Reverse Zone Entry###
zone "1.168.192.in-addr.arpa" IN {# IP Address
type master;
file "db.broexperts.local.rev";#Reverse Zone File Name
allow-update { none; };
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
BIND Installation& Configuration:
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
# named-checkconf
To verifyconfiguration done in correctmannersuse the following command
It will not throw anyerrorif configurations are done correctly, otherwise it will show errormessage.
Step-2: CreateZoneFiles.
Now let’s create zone files for ourdomain “broexperts.local” as mentioned in “named.conf”. To createthese
files we haveto use some sample files located under /var/named directory and namethemas per our zone
names, for forward zonewe need “db.broexperts.local.fwd” and for reversezone
“db.broexperts.local.rev” file. Let’s copy sample file and createour requiredfiles.
BIND Installation& Configuration:
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
# cd /var/named
# cp /var/named/named.localhost db.broexperts.local.fwd
# cp /var/named/named.loopback db.broexperts.local.rev
Wehave just created our forward and reversezone files under /var/named directory.
Step-2: Step-3: Configure Zone Files.
a) Forward Zone File
Theforward zone file will containall DNSrecords for forward DNS lookups, it means DNSwill look in
the forward zonefile wheneverDNS will receive a DNSquerye.g. to resolve client.broexperts.local.
Let’s edit and configure forward zonefile.
BIND Installation& Configuration:
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
# vi /var/named/db.broexperts.local.fwd
Simply delete all thesample contents in forward zonefile and paste below showing contents. Then update all
highlighted contents with yourown.
• ForwardlookupZonecontainsIPtohostname(FQDN)information
BIND Installation & Configuration:
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
DNSRecords
SOA:
Stands for Start of authority. It identifies authority of zoneandsome parameters like serial
number,refresh time, retrytime, A expire time. TimeTo Live (TTL).
A: Name-to-address mapping.
CNAME: Canonicalname (for aliases)
PTR: Pointer records means, IP to namemapping.
MX: Contains mail exchangerinformation for particular domain.
BIND Installation& Configuration:
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
$TTL 604800
@ IN SOA ns1.broexperts.local. admin.broexperts.local. (
3 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;Name Server
@ IN NS ns1.broexperts.local.
;A Records
ns1 IN A 192.168.1.114
client IN A 192.168.1.199
Forward Lookup Zone File Contents (/var/named/db.broexperts.local.fwd)
BIND Installation & Configuration:
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
b) Reverse Zone File
Thereversezone file wherewedefine all DNS PTRrecords for reverse lookup. Let’s say DNSreceives a
queryto resolve an IPAddress “192.168.1.199”into hostname, it will look into reverse lookup file and
returnFQDNwhich is client.broexperts.local in ourcase. Let’s configure db.broexperts.local.rev
file.
# vi /var/named/db.broexperts.local.rev
Copyand paste below contents into yourreverselookup file then replace all highlighted contents as per your
requirements.
• ReverselookupZonecontainshostname(FQDN)toIPinformation.
BIND Installation& Configuration:
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
$TTL 604800
@ IN SOA ns1.broexperts.local. admin.broexperts.local. (
3 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;Name Server
@ IN NS ns1.broexperts.local.
;A Record
ns1 IN A 192.168.1.114
;PTR Records
114 IN PTR ns1.broexperts.local.
199 IN PTR client.broexperts.local.
ReverseLookup Zone File Contents (/var/named/db.broexperts.local.rev)
BIND Installation& Configuration:
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
# named-checkzone broexperts.local db.broexperts.local.fwd
# named-checkzone broexperts.local db.broexperts.local.rev
Syntaxcheck
# zone broexperts.local/IN: loaded serial 3
OK
Output:
Both files syntax checkresult should beas showing above, if there is any syntax error
it will show errormessage.
BIND Installation& Configuration:
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
# chgrp named db.broexperts.local.fwd
# chgrp named db.broexperts.local.rev
# restorecon -rv /var/named
# restorecon /etc/named.conf
Step-4:Configure permissionsand ownerships on bind files
# firewall-cmd --permanent --add-service=dns
# firewall-cmd --reload
Step-5: Allow DNS Port 53 in Linux Firewall
BIND Installation& Configuration:
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
# systemctl start named
#systemctl enable named
Step-6:Start BIND and Enable the Serviceon Boot
Step-7: DNS Server Testing
I have a Linuxclient runningon mynetwork with hostname: client.broexperts.local and IP: 192.168.1.199.
Before testing, we must configureour client to use ns1.broexperts.local as a dns server, to do that, update the
dns resolver file on client.
# vi /etc/resolv.conf
Update the contents as showing below
search broexperts.local
nameserver 192.168.1.114
BIND Installation& Configuration:
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
dig forward lookup command result
BIND Installation& Configuration:
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
dig reverselookup commandresult
BIND Installation& Configuration:
For More Free Linux Guides Visit: www.broexperts.com 9/23/2017
Great.! Wehavesuccessfully configureda fullyfunctional Master/PrimaryDNS Server, if youface any
difficulty while applying this tutorial tell us in commentsection orfeel freeto send us email directly at
admin@broexperts.com
Want More Free Linux Stuff ?
Visit: BroExperts.com
Great.!Wehavesuccessfullyconfigureda fullyfunctionalMaster/PrimaryDNSServer, if youhave
anyquestionfeel freetosend usemail directlyat admin@broexperts.com
Want More Free Linux Stuff ?
Visit: BroExperts.com

More Related Content

Recently uploaded

MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 

Recently uploaded (20)

MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 

Featured

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data ScienceChristy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slidesAlireza Esmikhani
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming LanguageSimplilearn
 

Featured (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

How To Configure BIND as a DNS Server on RHEL7/CentOS7/Fedora26

  • 1. How To Configure BIND as a Primary DNS Server on RHEL7 / CentOS7 Author: Hafiz Haider Website: www.BroExperts.com Email: admin@broexperts.com Step by Step Guide By : BroExperts.com
  • 2. Introduction: What is DNS? DNS(Domain NameSystem) is a hierarchical structurethat is responsible for resolving hostnames into theirnumerical IPaddresses for computer systems and vice versa. • Domain NameSystemhasbeenused ontheinternet and inthe privatenetworks aswell. Primary or Master DNS Server A Primaryor Master DNSserver has authority of its domain and it is maintainerof domain’s original zonedata. Domain zone files are maintainedon the primary DNSservers and theycan propagate domain’s record to secondary servers. For More Free Linux Guides Visit: www.broexperts.com
  • 3. For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 Lab Network Details: Client For DNSTesting IP: 192.168.199 FQDN: client.broexperts.local OS: CentOS7.3(Min Install) Lab Server Domain: broexperts.local IP: 192.168.1.114 FQDN: ns1.broexperts.local OS: CentOS7.3(Min Install)
  • 4. Our Goal: For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 At the endof this tutorial you will beable to know How To ConfigureBIND as a DNS Serveron RHEL7, and finally you will test DNS serverfunctionality over the network.
  • 5. BIND Installation& Configuration: For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 Step-1: InstallBIND Package Installed requiredpackages bind and bind-utils using following yumcommand: # yum install bind bind-utils -y Step-2: ZoneEntryin /etc/named.conf file After installing requiredbind packages, its time to edit main configuration file named.conf, which controls the behavior and functionality of BIND. Below i havementioned mymodified /etc/named.conf file with changesas per mynetworkand zone entryof domain “broexperts.local” as mentioned above in lab server details. Open /etc/named.conf file
  • 6. BIND Installation& Configuration: For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 # vi /etc/named.conf youcan edit your named.conf file as per yourrequirements by following all highlighted changesdone by meas shown below options { listen-on port 53 {192.168.1.114; }; 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 { 192.168.1.0/24;}; recursion no; dnssec-enable yes; dnssec-validation yes; /* Path to ISC DLV key */ bindkeys-file "/etc/named.iscdlv.key"; managed-keys-directory "/var/named/dynamic"; pid-file "/run/named/named.pid"; session-keyfile "/run/named/session.key"; };
  • 7. BIND Installation& Configuration: For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 logging { channel default_debug { file "data/named.run"; severity dynamic; }; }; zone "." IN { type hint; file "named.ca"; }; ###Forward Zone Entry### zone "broexperts.local" IN {#Domain Name type master; file "db.broexperts.local.fwd"; #Forward Zone File Name allow-update { none; }; }; ###Reverse Zone Entry### zone "1.168.192.in-addr.arpa" IN {# IP Address type master; file "db.broexperts.local.rev";#Reverse Zone File Name allow-update { none; }; }; include "/etc/named.rfc1912.zones"; include "/etc/named.root.key";
  • 8. BIND Installation& Configuration: For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 # named-checkconf To verifyconfiguration done in correctmannersuse the following command It will not throw anyerrorif configurations are done correctly, otherwise it will show errormessage. Step-2: CreateZoneFiles. Now let’s create zone files for ourdomain “broexperts.local” as mentioned in “named.conf”. To createthese files we haveto use some sample files located under /var/named directory and namethemas per our zone names, for forward zonewe need “db.broexperts.local.fwd” and for reversezone “db.broexperts.local.rev” file. Let’s copy sample file and createour requiredfiles.
  • 9. BIND Installation& Configuration: For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 # cd /var/named # cp /var/named/named.localhost db.broexperts.local.fwd # cp /var/named/named.loopback db.broexperts.local.rev Wehave just created our forward and reversezone files under /var/named directory. Step-2: Step-3: Configure Zone Files. a) Forward Zone File Theforward zone file will containall DNSrecords for forward DNS lookups, it means DNSwill look in the forward zonefile wheneverDNS will receive a DNSquerye.g. to resolve client.broexperts.local. Let’s edit and configure forward zonefile.
  • 10. BIND Installation& Configuration: For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 # vi /var/named/db.broexperts.local.fwd Simply delete all thesample contents in forward zonefile and paste below showing contents. Then update all highlighted contents with yourown. • ForwardlookupZonecontainsIPtohostname(FQDN)information
  • 11. BIND Installation & Configuration: For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 DNSRecords SOA: Stands for Start of authority. It identifies authority of zoneandsome parameters like serial number,refresh time, retrytime, A expire time. TimeTo Live (TTL). A: Name-to-address mapping. CNAME: Canonicalname (for aliases) PTR: Pointer records means, IP to namemapping. MX: Contains mail exchangerinformation for particular domain.
  • 12. BIND Installation& Configuration: For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 $TTL 604800 @ IN SOA ns1.broexperts.local. admin.broexperts.local. ( 3 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ;Name Server @ IN NS ns1.broexperts.local. ;A Records ns1 IN A 192.168.1.114 client IN A 192.168.1.199 Forward Lookup Zone File Contents (/var/named/db.broexperts.local.fwd)
  • 13. BIND Installation & Configuration: For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 b) Reverse Zone File Thereversezone file wherewedefine all DNS PTRrecords for reverse lookup. Let’s say DNSreceives a queryto resolve an IPAddress “192.168.1.199”into hostname, it will look into reverse lookup file and returnFQDNwhich is client.broexperts.local in ourcase. Let’s configure db.broexperts.local.rev file. # vi /var/named/db.broexperts.local.rev Copyand paste below contents into yourreverselookup file then replace all highlighted contents as per your requirements. • ReverselookupZonecontainshostname(FQDN)toIPinformation.
  • 14. BIND Installation& Configuration: For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 $TTL 604800 @ IN SOA ns1.broexperts.local. admin.broexperts.local. ( 3 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ;Name Server @ IN NS ns1.broexperts.local. ;A Record ns1 IN A 192.168.1.114 ;PTR Records 114 IN PTR ns1.broexperts.local. 199 IN PTR client.broexperts.local. ReverseLookup Zone File Contents (/var/named/db.broexperts.local.rev)
  • 15. BIND Installation& Configuration: For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 # named-checkzone broexperts.local db.broexperts.local.fwd # named-checkzone broexperts.local db.broexperts.local.rev Syntaxcheck # zone broexperts.local/IN: loaded serial 3 OK Output: Both files syntax checkresult should beas showing above, if there is any syntax error it will show errormessage.
  • 16. BIND Installation& Configuration: For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 # chgrp named db.broexperts.local.fwd # chgrp named db.broexperts.local.rev # restorecon -rv /var/named # restorecon /etc/named.conf Step-4:Configure permissionsand ownerships on bind files # firewall-cmd --permanent --add-service=dns # firewall-cmd --reload Step-5: Allow DNS Port 53 in Linux Firewall
  • 17. BIND Installation& Configuration: For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 # systemctl start named #systemctl enable named Step-6:Start BIND and Enable the Serviceon Boot Step-7: DNS Server Testing I have a Linuxclient runningon mynetwork with hostname: client.broexperts.local and IP: 192.168.1.199. Before testing, we must configureour client to use ns1.broexperts.local as a dns server, to do that, update the dns resolver file on client. # vi /etc/resolv.conf Update the contents as showing below search broexperts.local nameserver 192.168.1.114
  • 18. BIND Installation& Configuration: For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 dig forward lookup command result
  • 19. BIND Installation& Configuration: For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 dig reverselookup commandresult
  • 20. BIND Installation& Configuration: For More Free Linux Guides Visit: www.broexperts.com 9/23/2017 Great.! Wehavesuccessfully configureda fullyfunctional Master/PrimaryDNS Server, if youface any difficulty while applying this tutorial tell us in commentsection orfeel freeto send us email directly at admin@broexperts.com Want More Free Linux Stuff ? Visit: BroExperts.com
  • 21. Great.!Wehavesuccessfullyconfigureda fullyfunctionalMaster/PrimaryDNSServer, if youhave anyquestionfeel freetosend usemail directlyat admin@broexperts.com Want More Free Linux Stuff ? Visit: BroExperts.com

Editor's Notes

  1. To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image.