How to set up Internet connection sharing with iptables on Linux

In this tutorial, I’ll explain how to share a single Internet connection among multiple devices on Linux. While consumer-grade WiFi routers have become mainstream nowadays, making this problem a non-issue, suppose you don’t have one at home. However, say you have a Linux box already assembled with a modem and a LAN card. The modem […]
Continue reading…

 

How to close an open DNS resolver

The DNS server that we have created in the previous tutorial is an open DNS resolver. An open resolver does not filter any incoming requests, and accepts queries from any source IP address. Unfortunately, an open resolver can become an easy target to attackers. For example, attackers can initiate a Denial of Service (DoS) or […]
Continue reading…

 

How to set up a secondary DNS server in CentOS

In the previous tutorial, we created a primary DNS server (ns1) for a test domain example.tst. In this tutorial, we will create a secondary DNS server (ns2) for the same domain by using bind package on CentOS. When it comes to setting up a secondary DNS server, the following factors should be kept in mind. […]
Continue reading…

 

How to set up a primary DNS server using CentOS

Any operational domain has at least two DNS servers, one being called a primary name server (ns1), and the other a secondary name server (ns2). These servers are typically operated for DNS failover: If one server goes down, the other server becomes an active DNS server. More sophisticated failover mechanisms involving load balancers, firewalls and […]
Continue reading…

 

How to check DNS propagation on Linux

While DNS introduces human-readable naming schemes for Internet hosts, it also brings with it extra overhead associated with resolving names to IP addresses. For end users, this overhead means additional DNS lookup latency for accessing any Internet host. For service providers, this implies the performance-critical DNS infrastructure that needs to be maintained. Minimizing these overheads […]
Continue reading…

 

How DNS works

Domain Name System (DNS) is one of the most critical services in the Internet. Without DNS, we would not be able to access the web. Before going into the details on how DNS works, a little on the background may be helpful. When you are accessing, say, Google, your traffic originates from your computer, goes […]
Continue reading…

 

How to set up a secure Apache webserver on Ubuntu

This tutorial assumes that you have a running Ubuntu Server, that networking has been set up, and that you have ssh access. Apache2 is the default webserver used by many Linux installations. It is not the only one available, or the best for all circumstances, but it covers many usage scenarios. During the installation, you […]
Continue reading…

 

How to use a custom DNS server on Ubuntu Desktop

In Linux, DNS servers are specified in /etc/resolv.conf. However, a proper way to configure custom DNS settings on Ubuntu Desktop is not manually modifying /etc/resolv.conf, but using a separate GUI-based network management program which controls the content of /etc/resolv.conf. The default such program used by Ubuntu Desktop is called NetworkManager which is responsible for configuring […]
Continue reading…

 

/etc/hosts vs. /etc/resolv.conf

When an application performs DNS lookup as part of its operations on Linux, it can leverage both /etc/hosts and /etc/resolv.conf configuration files to resolve DNS names. How these configuration files are used for DNS lookup can vary among different applications, complicating system administration. But Linux libc library and the GNU C Library (glibc) provides a […]
Continue reading…