What is name server in linux

What is name server in Linux?

Nameserver is the DNS server to which your machine query for name resolutions. This is pretty much important on servers facing the Internet or having an active internet connection or if your system is part of an organization where the internal domain name system is implemented for IT Infra.

How do I create a name server?

Step Two: Create Custom NameServers

  1. Go to your registrar and log in with your credentials for your Default Domains account.
  2. Click on the Domains menu item and select My Domains.
  3. Click on Domain Management and the domain name that you want create a custom name server for.

How do I print a Unix server name?

Print the hostname of the system The basic functionality of the hostname command is to display the name of the system on the terminal. Just type the hostname on the unix terminal and press enter to print the hostname.

How do I find my DNS server IP?

Open the “Command Prompt” and type “ipconfig /all”. Find the IP address of the DNS and ping it. If you were able to reach the DNS server through a ping, then that means that the server is alive.

In which language Unix is written?

C
Assembly language
Unix/Programming languages
Unix was originally written in assembly language, but was soon rewritten in C, a high-level programming language. Although this followed the lead of Multics and Burroughs, it was Unix that popularized the idea.

How to find out my server name in Linux?

Why is it important to have a nameserver in Linux?

How to set the host name in Linux?

How to configure nameserver in Linux kernel talks?

Источник

What are DNS Nameserver Types in Linux

Domain Name System (DNS) is a network service that maps, or resolves, domain names to their respective IP addresses. It reduces the need for users to remember IP addresses because they can refer to machines on the network by name. The mapping done by /etc/hosts on a small local area network (LAN) is handled by DNS on large networks, including the Internet.

Nameserver Types

1. Authoritative nameservers

– An authoritative nameserver responds to queries about names that are part of their zones only.
– Authoritative nameservers can be either primary (master) nameservers or secondary (slave) nameservers.
– Each zone has at least one authoritative DNS server.
– A DNS query returns information about a domain and specifies which DNS server is authoritative for that domain.

Читайте также:  Linux смена владельца всех файлов

2. Primary nameserver (master nameserver)

– A primary nameserver, or master nameserver, is the authoritative server that holds the master copy of zone data. –
– Secondary nameservers, or slave nameservers, are also authoritative but copy zone information from the master nameserver or from another slave nameserver.
– A nameserver can also serve as a primary or secondary server for multiple zones at the same time.

3. Caching-only nameservers (recursive nameservers)

– Caching-only nameservers, or recursive nameservers, offer resolution services but they are not authoritative for any zone.
– These DNS cache nameservers store answers to previous queries in cache (memory) for a fixed period of time.
– When a caching-only nameserver receives a query, it answers from cache if it can. If it does not have the answer in cache, it forwards the query to an authoritative server.
– Although it is not recommended for reasons of security, nameservers can also be configured to give authoritative answers to queries in some zones, while acting as a caching-only nameserver for all other zones.

Источник

DNS Configuration in Linux

DNS Configuration in Linux

DNS(Domain Naming System) is an internet service that translates the domain name to IP address that is understandable by the computer. For example, the domain name www.domainsystem.com might translate to 198.105.232.4. This process is the backbone of the internet and very important in the server. In this topic, we are going to learn about DNS Configuration in Linux.

Web development, programming languages, Software testing & others

DNS Configuration

Before going for DNS configuration in Linux, one should first understand the basics of DNS and how it works.

1. Domain Names

Consider the website www.facebook.com. This is called FQDN (Fully Qualified Domain Name) Each domain consists of domain components, the dot separates these components.

The text com is the top-level domain component and Facebook is the second-level domain component and www is the third-level domain component

dot is called the root domain.

2. Subdomains

When you visit a website like newsroom.facebook.com. the newsroom here is a subdomain of facebook.com. Only the name servers for newsroom.facebook.com know all the hosts existing beneath it, so Facebook answers if there is newsroom subdomain or not, the root name servers have no clue about that.

Types of DNS Servers

There are three types of DNS servers:

Primary DNS servers: The primary DNS server holds the master copy of the domain’s configuration files. They contain information like IP address and administrator’s details.

Secondary DNS server (slave): They contain the read-only copy of domain information that they get from the primary DNS server. This is useful when the primary server is down the Secondary server acts as a backup.

Caching DNS server: A caching DNS server holds the data of recently requested queries from the users so that the workload of primary and secondary servers is reduced.

Читайте также:  Как подключить наушники на linux

INSTALL BIND

Let’s see how to install bind on different Linux distributions.

On Debian/Ubuntu Linux, use the following syntax

$ sudo apt-get install bind9

On Redhat/CentOS/Fedora system, use the following syntax

/etc/bind directory contains all the DNS configurations. /etc/bind/named.conf is the primary configuration that includes all other needed files. The file named /etc/bind/db.root specifies the root nameservers in the world.

After completing the installation you can start it and enable it to run at boot time.

$ systemctl start named $ systemctl enable named

CONFIGURING BIND

The service configuration file is /etc/named.conf file

DEFINING PRIMARY ZONE

For defining the primary zone in /etc/named.conf file the syntax is as follows

The zone statement allows you to define a particular DNS zone.

The file which contains the zone information is located in the directory called /var/named.

Since this is the primary zone the type is master.

DEFINING A SECONDARY ZONE

The domain name in the secondary zone is the same as that of the primary zone and the type is slave since this is the secondary zone. the master’s option is to specify the IP addresses of the primary name server and the file indicates the path of the primary zone files.

DEFINING A CACHING ZONE

The caching zone decreases the queries on the DNS server. For defining a caching zone we need to define 3 zone sections.

Here the dot indicates the root name servers. The type hint indicates caching zone entry ane the file “root.hint”; specifies the file that contains the root servers.

The third zone performs the reverse lookup for the localhost.

Putting these three zones on /etc/named.conf will make our system work like a caching DNS server. Now we should type the content of the files referenced like abcexample.com.db, localhost.db, and 127.0.0.revThese files contain the DNS record types for each zone with some kind of options. Let us see about those record types.

DNS RECORD TYPES

SOA : start of authority record

SOA record is the information stored in the DNS zone about the zone and other records. It defines the properties of the zone.

It should contain the following information

IN (zone class) IN stands for internet

Primary master name server

The serial number for the zone

Refresh, retry, expire and TTL time in seconds

abcexample.com. 86400 IN SOA ns1.abcexample.com.mail.abcexample.com. ( 2020020204 ;serial 86400 ;refresh, seconds 8200 ;retry, seconds 3600000 ;expire, seconds 86400 ;minimum, seconds )

Query the SOA Record using

dns configuration in linux output 1

NAME SERVER RECORD(NS)

It is used to specify the name server for the zone.

IN NS ns1.abcexample.com. IN NS ns2.abcexample.com.

Query the NS Record using

dns configuration in linux output 2

ADDRESS RECORD(A & AAAA)

This record maps the hostname to the corresponding IP address

POINTER RECORD (PTR)

This record does the opposite of the address record. It will map the IP address to the hostname

192.168.1.5 IN PTR support.example.com.

MAIL EXCHANGE RECORD(MX)

It is a type of DNS record used to specify the mail server that is responsible for accepting emails on behalf of the domain.

Domain TTL Class Type Priority Host abcexample.com. 1936 IN MX 10 onemail.abcexample.com abcexample.com. 1936 IN MX 10 twomail.abcexample.com

here the priority indicates which mail server should be preferred. Higher the priority value higher will be the priority.

Читайте также:  Linux kernel source example

Query the MX Record using

output 3

CANONICAL NAME RECORD(CNAME)

Canonical name record is a type of DNS record that specifies alias or nickname for the host.

NAME TYPE VALUE -------------------------------------------------- abc.example.com. CNAME cab.example.com. cab.example.com. A 192.0.2.23

TEXT RECORD (TXT)

A text record is a type of DNS record that enables you to add any text like the contact information or any other information that you want the users to know about your domain.

abcexample.com. IN TXT "welcome to our website"

DNS TTL VALUE

TTL stands for time to live.

The TTL value informs bind about the life span of each record. The unit used is in seconds. The common ttl value is 86400 ( 24 hours ). lower ttl may cause heavy traffic loads on the authoritative name server.

CATCHING CONFIGURATION ERRORS

You may make errors while writing a zone file. You can diagnose those errors from the log using the following syntax

HOST COMMAND

After you have successfully added and modified your resource records you can check whether your host is resolved correctly using the following command

If you provide the hostname it will return the corresponding IP address

Also if you provide the IP address it will return the hostname.

WHOIS COMMAND

The whois command is used to get the details of the owner of the domain. The details may be information like a contact number or phone number.

RNDC COMMAND

The rndc command is used to secure your name server from both locally and a remote place. To prevent any unauthorized access to your name server rndc must be configured on the selected port (port 953 by default)

You can check the status of the dns server using the following command.

If you make any change to any of the zone files you can reload the service using the following command

$ rndc reload abcexample.com

You can reload all zone files using the following command

If you add new zones or you change the configuration of the server you can reload the configuration using the following command.

In this article, we have seen about DNS and how to install and configure the DNS server using Linux.

We hope that this EDUCBA information on “DNS Configuration in Linux” was beneficial to you. You can view EDUCBA’s recommended articles for more information.

502+ Hours of HD Videos
54 Courses
4 Mock Tests & Quizzes
Verifiable Certificate of Completion
Lifetime Access
4.5

57+ Hours of HD Videos
15 Courses
9 Mock Tests & Quizzes
Verifiable Certificate of Completion
Lifetime Access
4.5

Источник

Оцените статью
Adblock
detector