đŸ•šī¸
Ghoulsec Vault
Website Toolbase
  • Welcome !
  • đŸ—ƒī¸Exam Prep Notes
    • 📔CEH V13 (Master Edition)
      • Module 02: Footprinting and Reconnaissance
      • Module 03: Scanning Networks
      • Module 04: Enumeration
      • Module 05: Vulnerability Analysis
      • Module 06: System Hacking
      • Module 07: Malware Threats
      • Module 08: Sniffing
      • Module 09 : Social Engineering
      • Module 10: Denial of Service
      • Module 11: Session Hijacking
      • Module 12: Evading IDS, Firewalls , Honeypots
      • Module 13: Hacking web servers
      • Module 14: Hacking Web Applications
      • Module 15:SQL Injection
      • Module 16: Wireless Attacks
      • Module 17: Hacking Mobile Platforms
      • Module 18: IoT & OT Hacking
      • Module 19 : Cloud Computing
      • Module 20 : Cryptography
    • 📘ISC2 -Certified in Cyber Security
      • Chapter -1 Security Principals
      • Chapter -2 Disaster Recovery,Business Continuity & Incident Response
      • Chapter -3 Access Control Concepts
      • Chapter -4 Network Security
      • Chapter -5 Security Operations
    • 📗AZ - 900
      • Basics of Cloud Computing
        • Economic of Scale
        • CapEx & OpEx
        • Consumption based model
        • Cloud Deployment Models
        • Shared Responsibility Model
        • Data centers, Regions & Availability Zones & Geographyies in Azure
        • Resources & Resource Group
        • Azure Access Tools
        • Azure Service Lifecycle
        • Azure SLAs
        • Azure Cloud Adoption Framework
      • Azure Services
        • Azure Computing Services
        • Azure Networking Services
        • Azure Storage Services
        • Azure Database Service
        • Azure Marketplace
        • Big Data & Azure
        • Azure Serverless Computing
        • IoT & Azure
        • Other Azure Services
        • Azure Resource Locks & Resource Tags
        • Azure Security Services
          • Security Groups
          • Routing Tables
          • Azure Firewall
          • Azure DDOS Protection
          • Azure Identity & Access Management (Azure AD)
          • Azure RBAC
          • Azure Security Center
          • Azure Key Vault
      • Azure policies & Blueprints
      • Azure Cost Management
      • Azure Core Tenents
    • 📗SC - 900
      • Zero Trust Model
      • Shared Responsibility Model
      • Defense in Depth
      • Security Controls
      • CIA Triad
      • Encryption / Hashing / Signing
      • Microsoft Security & Compliance Principals
      • Common Identity Attacks
      • Microsoft Identity as Primary Security Perimeter
      • Modern Authentication with Azure AD
      • Azure AD Identity Types
      • Azure External Identities
      • Hybrid Identities
      • Authentication Methods & Password Protection
      • Conditional Access
      • Azure AD Roles & RBAC
      • Governance in Azure AD
      • Azure Identity Protection
      • Azure NSG, DDOS, Firewall
      • Azure Bastion & Keyvault
      • Azure Encryption
      • Azure CSPM
      • Azure Security Center
      • Azure Defender
        • Microsoft O365 Defender
        • Azure Sentinel
      • Microsoft Cloud App Security
      • Microsoft Intune
      • Microsoft Complaince Manager
      • Information Protection
      • Microsoft insider risk capabilities
    • 📔AWS Cloud Practitioner
      • Cloud Deployment
        • AWS Global Infrastructure
      • AWS Cloud Essentials
        • AWS SNS
          • AWS SQS
      • AWS Compute & Container Services
        • AWS EC2
          • Elasticity & Agility
        • AWS Serverless Computing
        • AWS Container Services
        • AWS Beanstalk
        • AWS Load Balancing
      • AWS Storage & Databases
      • AWS Networking
      • AWS Security
        • AWS Organisation
        • AWS Compliance
        • AWS DDOS
        • Additional Security Services
      • AWS Monitoring & Analytics
        • Other Analytics Services
      • AWS Pricing & Support
      • AWS Migration & Innovation
        • Migration Statergies
        • AWS Snow Family
        • AWS Transfer Family
        • Innovation on AWS
      • AWS Well Architecture Framework
      • Other AWS Services
  • 🧑‍đŸ’ģCyber Security Base
    • Ghoul's Den
    • Cheatsheets
    • SSL Handbook
      • Installing OpenSSL
      • Encrypting Web Servers using SSL
      • Compiling .pfx file using openssl
      • De-compiling .pfx file
      • Zimbra Mail Server SSL renew
      • SSL Certificates
    • â˜ī¸Cloud Security
      • Amazon Web Services (AWS)
        • AWS - IAM & Policy Management
        • AWS Organization
        • AWS - Roles (Assume Role)
        • AWS - EC2 (Elastic Computing)
        • AWS - VPC
        • AWS - Bastion Host
        • AWS Application Load Balancer
        • AWS Auto Scaling Group
        • AWS WAF
        • AWS - VPC Peering
        • AWS Transit Gateway
        • AWS NAT Gateway
        • AWS - Route 53
        • AWS Certificates Manager
        • AWS Network Load Balancer (NLB)
    • đŸ•¸ī¸Network Security
      • Firewalls
        • Sophos - Security Suite
          • Sophos Firewalls
      • VPN
        • VPNs
          • Wireguard Tunneling
          • StrongSwan Gateway VPN Server on Ubuntu
      • IP Address and IP Subnetting
      • Basic to Advance Networking Materials
    • 🧑‍đŸ’ģVAPT
      • Sample Report Templete
      • OWASP
        • OWASP Web Application Security & WebGoat
      • Web Application testing checklist
        • Client Side Penetration Testing
          • Clickjacking
          • Websockets
          • CSRF
          • XSS Filters
        • Server Side Penetration Testing
        • Advanced Web Application Pentesting
          • OAuth
          • JWT Injection
          • Server Side Templete Injection
    • â˜„ī¸GRC
      • ISMS AUDIT PLAN
      • CIS Compliance Windows
    • 🔍Forensic
      • Forensic Tools
      • EMAIL Forensics
      • File header forensics
    • Trend Micro
      • Deep Security
        • Installation & Prerequisite
          • Microsoft SQL server 2022
          • Postgres 16 Core
          • Installation
    • Practical Malware Analysis & API Threats
  • đŸ•šī¸Server are fun !
    • Securing Linux
      • Securing SSH
      • Sudoers
      • UFW (Uncomplicated FW)
      • Unattended Upgrades
      • Password Complexiety
      • Auditing Linux
      • Samba - SMB
      • NFS - Network File System
      • FTP
      • AIDE
    • Servers
      • Linux Sever
        • OpenLDAP Server Setup
          • ldap-account-manager
          • Securing OpenLDAP
          • OpenLDAP client setup
          • Checking LDAP setup
        • Users & Groups
        • Password Policy
        • File & File Permissions
        • Automatic Updates
        • Adding GUI to Ubuntu Server
        • DNS Server
        • NTP Server
      • Windows Sever
        • Deep dive into Windows Server
        • Windows server Installation
        • Disable IPv6
        • Disable Server Manager on startup
        • Promoting OS to AD server
        • AD DNS
        • AD DHCP
        • AD Activation
        • AD Users & Groups
        • AD FileServer
        • Adding Users into AD
        • Bulk Importing users into Domain
        • Windows AD Resources
        • Group Policy Editor
          • Creating First Policy
          • Restricting CMD & Powershell
          • Password Policies
          • Audit Policies
          • Log Retention Policy
          • Windows Defender Firewall
          • Patch Management & Window Updates
        • Setting Up local accounts for windows hosts
    • Hacking Systems
      • Linux Systems
        • Battery Charge Threshold (Linux)
        • Metasploitable OS Complete Solved
      • Tricking Windows
        • Bitlocker & Time based policy bypass
    • Monitoring HeartBeats
    • RAID Technology
    • Managing Partitions
      • Parted
      • Fdisk
      • LVM
        • Re-claiming unused disk space
        • Adding physical volume into VG
        • Removing physical volume from VG
      • SWAP Memory
    • Virtualization
      • Proxmox
        • Proxmox VE Installation
        • Default Storage Expansion
        • Proxmox Network Link Aggegration
        • NAT Interface Configuration
        • Importing disk into proxmox
        • Creating an LVM Thin Pool
        • Proxmox IAM
  • đŸ™â€â™‚ī¸Dan the AI Expert
    • Ollama Ollama ...
      • Ollama
        • Ollama models
        • Open Web UI & Ollama Integration
    • Microsoft Presentation using AI
  • đŸ›Ąī¸Security Operations
    • Wazuh - Open Source XDR. Open Source SIEM.
      • Components
      • Deployment Methods
      • Installation
        • Single Node Installation
          • Wazuh Indexer Installation
          • Wazuh Server Installation
          • Wazuh Dashboard Installation
          • Single node deployment with Script
        • Managing multiple Wazuh clusters with Cross-Cluster Search
          • Cluster Configuration
          • Set up Cross-Cluster Search
        • Upgrading Wazuh Central Components
        • Uninstalling Wazuh
      • Custom Decoder & Rules
        • Pfsense Decoders
        • Pfsense Rules
      • Security Operations Center Tools (Wazuh)
    • IRIS-DFIR / Case Management
    • Graylog & ElasticSearch
    • Zabbix NMS
      • Zabbix Installation
      • Zabbix Database Management
        • Zabbix Database backup
        • Zabbix Database restore
        • MySQL Replication (M-M)
        • MySQL Replication (M-W)
      • Zabbix Geomap Setup
      • Adding Hosts into Zabbix
      • Zabbix Hostgroups
      • Auto Registration Hosts Zabbix
      • Zabbix Globalscrips
      • Zabbix HA Cluster
      • Zabbix Proxy
      • Zabbix Notifications
      • Zabbix Maintainance
      • Zabbix User Management & Authentication
      • Zabbix Housekeeping
      • Scheduled Reporting
      • Service Monitoring using Zabbix
  • Git the master!!
    • Configuring git
    • Git Branches
    • Undoing changes
    • Git - Cheat sheet
    • My first git...
Powered by GitBook
On this page
  • Section 1: Setting Up Forward DNS
  • Section 2: Setting Up Reverse DNS
  • Section 3: Additional Configuration and Verification
  1. Server are fun !
  2. Servers
  3. Linux Sever

DNS Server

This document outlines the process of setting up and configuring Forward DNS and Reverse DNS using the BIND9 DNS server on an Ubuntu system. The process includes configuration steps, common practices, and troubleshooting techniques.


Section 1: Setting Up Forward DNS

What is Forward DNS?

Forward DNS (also called Forward Lookup) is the process of mapping a domain name to its corresponding IP address. For example, converting www.example.com to 93.184.216.34. In this setup, the DNS server resolves domain names to IP addresses.

Steps for Forward DNS Configuration

1. Install BIND9 DNS Server

To begin, the first step is to install the BIND9 package, which provides the DNS server functionality:

sudo apt update
sudo apt install bind9 bind9utils bind9-doc

2. Create a Zone File for Your Domain

A zone file is required to define the records for your domain. This file contains the mappings of hostnames to IP addresses for your domain. The zone file can be created at /etc/bind/db.example.com (replace example.com with your actual domain).

Example zone file (/etc/bind/db.example.com):

$TTL 86400
@    IN    SOA   ns1.example.com. admin.example.com. (
                          2025032501 ; Serial
                          3600       ; Refresh
                          1800       ; Retry
                          1209600    ; Expire
                          86400 )    ; Minimum TTL

@    IN    NS    ns1.example.com.
ns1  IN    A     102.50.1.17
www  IN    A     102.50.1.10
iten IN    A     102.20.1.100
  • NS Record: Indicates that ns1.example.com is the nameserver for this domain.

  • A Records: Map hostnames to IP addresses (e.g., www.example.com to 102.50.1.10).

3. Define the Zone in BIND Configuration

Next, you'll need to tell BIND9 about the domain and its associated zone file. To do this, edit /etc/bind/named.conf.local:

sudo nano /etc/bind/named.conf.local

Add the following lines:

zone "example.com" {
    type master;
    file "/etc/bind/db.example.com";
};

This configuration tells BIND9 that the domain example.com should use the zone file located at /etc/bind/db.example.com.

4. Restart BIND9

After configuring the zone, restart BIND9 to apply the changes:

sudo systemctl restart bind9

5. Verify Forward DNS Setup

To verify that the forward DNS is working correctly, use dig or nslookup:

dig @102.50.1.17 www.example.com

If configured correctly, it should return the IP address 102.50.1.10.


Section 2: Setting Up Reverse DNS

What is Reverse DNS?

Reverse DNS (also called Reverse Lookup) is the process of resolving an IP address back to a domain name. For example, given the IP address 102.50.1.10, reverse DNS will return a hostname, such as www.example.com.

Steps for Reverse DNS Configuration

1. Create a Reverse DNS Zone File

A reverse zone file is needed to map IP addresses to domain names. In this case, since we are using the 102.50.1.0/24 network, we will create a file /etc/bind/db.102.50 for the reverse lookup.

Example reverse zone file (/etc/bind/db.102.50):

$TTL 86400
@    IN    SOA   ns1.example.com. admin.example.com. (
                          2025032501 ; Serial
                          3600       ; Refresh
                          1800       ; Retry
                          1209600    ; Expire
                          86400 )    ; Minimum TTL

@    IN    NS    ns1.example.com.
17   IN    PTR   ns1.example.com.
10   IN    PTR   www.example.com.
  • PTR Records: These recorDNS Server Configuration Documentation for BIND9 on Ubuntu Introductionds map IP addresses back to domain names. For example, 102.50.1.10 maps to www.example.com.

2. Define the Reverse Zone in BIND Configuration

To configure the reverse DNS zone, edit /etc/bind/named.conf.local and add the following lines:

sudo nano /etc/bind/named.conf.local

Add the reverse zone configuration for 102.50.1.0/24:

zone "50.102.in-addr.arpa" {
    type master;
    file "/etc/bind/db.102.50";
};

This configuration tells BIND9 that for IP addresses in the range 102.50.1.x, the reverse DNS lookup should use the /etc/bind/db.102.50 zone file.

3. Restart BIND9

After configuring the reverse zone, restart the BIND9 service again:

sudo systemctl restart bind9

4. Verify Reverse DNS Setup

To verify that reverse DNS is configured correctly, use dig or nslookup with an IP address:

dig -x 102.50.1.10 @102.50.1.17

If configured properly, it should return the domain name www.example.com for the IP 102.50.1.10.


Section 3: Additional Configuration and Verification

BIND9 Service Configuration

  1. Ensure BIND9 Starts on Boot Ensure BIND9 starts automatically after a reboot:

    sudo systemctl enable bind9
  2. Check the BIND9 Service Status To verify that BIND9 is running:

    sudo systemctl status bind9
  3. Check DNS Resolution You can use dig or nslookup to test forward and reverse lookups:

    • Forward Lookup:

      dig @102.50.1.17 www.example.com
    • Reverse Lookup:

      dig -x 102.50.1.10 @102.50.1.17

Firewall Configuration

Ensure that your firewall allows DNS traffic (port 53):

sudo ufw allow 53

Disable IPv6 (Optional)

If you're not using IPv6, you can disable it in BIND9 to avoid related issues:

  1. Open the BIND options file:

    sudo nano /etc/bind/named.conf.options
  2. Add the following:

    options {
        listen-on-v6 { none; };
    };
  3. Restart BIND9:

    sudo systemctl restart bind9

PreviousAdding GUI to Ubuntu ServerNextNTP Server

Last updated 1 month ago

SOA Record: Specifies the authoritative name server (ns1.example.com) and the email of the administrator ().

đŸ•šī¸
admin@example.com