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:
- Configuring Linux to use a DNS server is very easy. Just add a single line to
/etc/resolv.conf
:nameserver 8.8.8.8
- 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
inresolv.conf
will allow you to pingmail.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...