Now of course, as part of your skill set as a Linux system administrator,
you need to be able to check DNS entries.
We can go ahead, and using our correct packager, we can go through and
install the BIND, the Berkeley Internet Name Daemon utilities. With this,
we get the dig command. When we dig our website, if we don't specify the
type of entry that we are looking for,
we will go through and get the address record coming back from that site,
but do check you are getting an answer coming back.
The output can be quite verbose, and it can be easy to miss
the fact you didn't actually get an answer.
We can also compare the entry that we're getting from our
default name server by going through and comparing it to a
different name server. Here, using the @ symbol, we're checking
the Google DNS server. So come on,
let's go through and get some good hands‑on knowledge.
Working out our command line on openSUSE,
we can go through and install dig and check our DNS entries.
So we're going to begin by using zypper, the package manager on openSUSE,
and we can then go to install and bind‑utils. So we can allow this to run
through, but again, it shouldn't take too long to run ahead, but this is
going to give us some very powerful tools. And as I then go through and
take a look, it gives me access to things like the host command where I
can then go through and check host www., we'll just do something like say
ford.com, something easy to type, where we can get simple aliases coming
back and address records. But more powerful than that, we can go through
and check for almost any entry type is the dig command.
So if I go through and use dig, and escape and dot brings up that last argument,
and we can then go through and start looking at our output.
But I say, by default, it is quite verbose, so make sure we have
actually got an answer section, and I can see there that we are actually
getting an answer, so our record has come back.
We can also check the DNS server that was queried.
Can you see the line towards the bottom that says SERVER?
That's the DNS server that we queried.
If I clear the screen and up arrow, if I want to check
against a known good DNS server,
I can then go through and do something like 8.8.8.8.
This is telling you then to go to a particular DNS server.
Again,
I can see the record of that server towards the bottom of
the screen, but we can then go through and compare the
records that we get back from,
let's say, our local server to a known good server on the internet.
Now, as an interesting side note again,
we can go through and take a look at a different DNS server.
Cloudflare has a DNS entry or a DNS server, 1.0.0.1.
But where we have middle 0s in an IPv4 address, even like our 127 address,
we can drop out and just use the start and end octet,
missing our middle octet.
Now you can see then once we get our server coming back,
it does expand to 1.0.0.1. But again, I have to say, how cool is this?