Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Linux Networking Cookbook
Linux Networking Cookbook

Linux Networking Cookbook: Over 40 recipes to help you set up and configure Linux networks

Arrow left icon
Profile Icon Dsouza Profile Icon Gregory Boyce
Arrow right icon
NZ$14.99 NZ$45.99
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (3 Ratings)
eBook Jun 2016 152 pages 1st Edition
eBook
NZ$14.99 NZ$45.99
Paperback
NZ$56.99
Subscription
Free Trial
Arrow left icon
Profile Icon Dsouza Profile Icon Gregory Boyce
Arrow right icon
NZ$14.99 NZ$45.99
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (3 Ratings)
eBook Jun 2016 152 pages 1st Edition
eBook
NZ$14.99 NZ$45.99
Paperback
NZ$56.99
Subscription
Free Trial
eBook
NZ$14.99 NZ$45.99
Paperback
NZ$56.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Linux Networking Cookbook

Chapter 2. Configuring DNS

In this chapter, we will cover:

  • Setting up your system to talk to a nameserver
  • Setting up a local recursive resolver
  • Configuring dynamic DNS on your local network
  • Setting up a nameserver for your public domain
  • Setting up a slave nameservers

Introduction

This chapter introduces the Domain Name System (DNS). You'll learn what DNS is, how it works, and how to configure it to work according to your requirements. We'll start by configuring your machines to be able to resolve hostnames, such as www.google.com and we'll work toward learning to configure your own domain.

Setting up your system to talk to a nameserver

In the previous chapter, we did some basic testing of your network connection by pinging other hosts by IP address directly. However, I'm sure you'd rather not visit web pages by requesting them by IP address, rather than by the domain name. This problem is solved using a recursive DNS server to resolve the hostnames into IP addresses, which your computer can then connect to.

How to do it…

Let's set up a DNS server to resolve the hostnames into IP addresses:

  1. Configuring Linux to use a DNS server is very easy. Just add a single line to /etc/resolv.conf:
    nameserver 8.8.8.8
  2. You may also want to add a domain line, which will allow you to access things by their hostname rather than by their fully qualified domain name (FQDN). For example, domain example.org in resolv.conf will allow you to ping mail.example.org as just mail.

If your system uses DHCP for receiving its IP address, then the content of this file can be managed through...

Setting up a local recursive resolver

Since all attempts to access a website require that you look up the hostname, the responsiveness of your nameserver can have a large impact on the loading of a webpage. A slow nameserver can delay the initial loading of the webpage as well as the loading of the various embedded images, video, and JavaScript, which might have been pulled third-party sites.

In this section, we'll be looking at setting up our own recursive nameserver, which will help cut down on the round trips between you and your resolver. We will additionally configure it to forward uncached queries to a public recursive nameserver in order to take advantage of their caching.

How to do it…

Let's set up the local recursive resolver:

  1. Install bind9 on Ubuntu; this can be done with sudo apt-get install bind9. On Red Hat and CentOS, it can be done with yum install bind instead. For other distributions, consult the relevant documentation.
  2. Add an allow-recursion entry in the options...

Configuring dynamic DNS on your local network

Right now you get your IP address configured automatically via DHCP and you're able to resolve DNS records from the internet via your DNS server. With the use of Dynamic DNS, you can also leverage your DNS server to address your local systems by name as well.

How to do it…

Let's configure dynamic DNS on your local network:

  1. First, we need to configure your bind instance to host DNS for your internal domain, as well as reverse DNS for your IP range. For our example, we'll use a domain of example.org:
    zone "example.org" {         
      type master;
      notify no; 
      file "/var/lib/bind/example.org.db";
    }
    zone "0.168.192.in-addr.arpa" {      
      type master;
      notify no; 
      file "/var/lib/bind/rev.1.168.192.in-addr.arpa"; 
    };
  2. Next we populate the zone in example.org.db:
    example.org.  IN  SOA  router.example.org. admin.example.org. (
      2015081401
      28800
      3600
      604800 
      38400
    )  
    example.org. ...

Setting up a nameserver for your public domain

Setting up a nameserver for a public domain works the same way as setting up a DNS server for an internal hostname, just with a few additional parts that we'll want to make sure are in a good state.

How to do it...

Let's set up a nameserver for a public domain:

  1. Set up a properly configured SOA record:
    example.org.  IN  SOA  ns1.example.org. admin.example.org. (
     2015081401
     28800
     3600
     604800 
     38400
    ) 
  2. Set up a record for NS hosts:
    Ns1    IN      A       192.168.1.1
  3. Set up glue records:
    $ORIGIN example.org
           IN      NS      ns1.example.org.
    Ns1    IN      A       192.168.1.1

How it works…

The first step is to configure the start of authority (SOA) for your domain. The SOA provides basic information about the zone itself. It contains a number of fields, including:

  • Example.org: The zone.
  • IN: Class of the record. IN is Internet, which you'll see for the majority of DNS records that you see.
  • SOA: Start of authority.
  • ns1.example.org...

Introduction


This chapter introduces the Domain Name System (DNS). You'll learn what DNS is, how it works, and how to configure it to work according to your requirements. We'll start by configuring your machines to be able to resolve hostnames, such as www.google.com and we'll work toward learning to configure your own domain.

Left arrow icon Right arrow icon

Key benefits

  • Move beyond the basics of how a Linux machine works and gain a better understanding of Linux networks and their configuration
  • Impress your peers by setting up and configuring a Linux server and its various network elements like a pro
  • This is a hands-on solution guide to building, maintaining, and securing a network using Linux

Description

Linux can be configured as a networked workstation, a DNS server, a mail server, a firewall, a gateway router, and many other things. These are all part of administration tasks, hence network administration is one of the main tasks of Linux system administration. By knowing how to configure system network interfaces in a reliable and optimal manner, Linux administrators can deploy and configure several network services including file, web, mail, and servers while working in large enterprise environments. Starting with a simple Linux router that passes traffic between two private networks, you will see how to enable NAT on the router in order to allow Internet access from the network, and will also enable DHCP on the network to ease configuration of client systems. You will then move on to configuring your own DNS server on your local network using bind9 and tying it into your DHCP server to allow automatic configuration of local hostnames. You will then future enable your network by setting up IPv6 via tunnel providers. Moving on, we’ll configure Samba to centralize authentication for your network services; we will also configure Linux client to leverage it for authentication, and set up a RADIUS server that uses the directory server for authentication. Toward the end, you will have a network with a number of services running on it, and will implement monitoring in order to detect problems as they occur.

Who is this book for?

This book is targeted at Linux systems administrators who have a good basic understanding and some prior experience of how a Linux machine operates, but want to better understand how various network services function, how to set them up, and how to secure them. You should be familiar with how to set up a Linux server and how to install additional software on them.

What you will learn

  • Route an IPv6 netblock to your local network
  • Modify your named instance to support setting hostnames for your IPv6 addresses
  • Use SSH for remote console access
  • Configure NGINX with TLS
  • Secure XMPP with TLS
  • Leverage iptables6 to firewall your IPv6 traffic
  • • Configure Samba as an Active Directory compatible directory service

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 28, 2016
Length: 152 pages
Edition : 1st
Language : English
ISBN-13 : 9781785285974
Concepts :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jun 28, 2016
Length: 152 pages
Edition : 1st
Language : English
ISBN-13 : 9781785285974
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just NZ$7 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just NZ$7 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total NZ$ 209.97
Practical Linux Security Cookbook
NZ$71.99
Ubuntu Server Cookbook
NZ$80.99
Linux Networking Cookbook
NZ$56.99
Total NZ$ 209.97 Stars icon
Banner background image

Table of Contents

13 Chapters
1. Configuring a Router Chevron down icon Chevron up icon
2. Configuring DNS Chevron down icon Chevron up icon
3. Configuring IPv6 Chevron down icon Chevron up icon
4. Remote Access Chevron down icon Chevron up icon
5. Web Servers Chevron down icon Chevron up icon
6. Directory Services Chevron down icon Chevron up icon
7. Setting up File Storage Chevron down icon Chevron up icon
8. Setting up E-mail Chevron down icon Chevron up icon
9. Configuring XMPP Chevron down icon Chevron up icon
10. Monitoring Your Network Chevron down icon Chevron up icon
11. Mapping Your Network Chevron down icon Chevron up icon
12. Watching Your Network Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(3 Ratings)
5 star 66.7%
4 star 0%
3 star 0%
2 star 33.3%
1 star 0%
Thomas Jul 28, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Lots of tips
Subscriber review Packt
Chris Lewis Nov 27, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This fixed Samba issues that I have been having forever. It gave me an 'in' to building a router, a project I have been bouncing off several times. Short, to the point, with brief explaners, follow every recipe and you will go from 'whaaa.. ..?' to 'aww yeah!'
Feefo Verified review Feefo
Just a guy with a job Apr 23, 2018
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
Sadly, rather shallow.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.