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 ...

Get Linux Networking Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.