So if you want to do DNS you're going to have to start with a DNS server and that's what I've got right
here.
Now to be fair a DNS server is software and right now the entire Internet pretty much runs on two very
famous DNS softwares.
The freeware bind that comes with all UNIX and Unix like systems and also the DNS server that comes
built in with Microsoft Windows Server.
Between those two versions of DNS that's probably 98 percent of all the DNS servers that are out there.
There's hundreds more but these are the two big ones.
But whatever the case is the actual setup what you have to do to get a DNS server running is pretty
much the same.
So with that understanding let's get a game plan of what we're going to set up and then we can actually
go ahead do that.
So the first thing we're going to have to do if we have a DNS server is well we have to have a domain.
So I'm going to make up a domain right now I'm going to call it classroom
dot local.
Now this is a very interesting domain because it's not dot com or dot edu or dot uk and those types
of things.
What we're looking at is a domain name that is not really for the Internet.
I'm going to be setting up this DNS server not to set up Web servers or anything like that but just
to allow all the computers in my office to be able to talk to each other.
So I'm going to give all these computers different names.
You can call this one student and believe it or not call this student one call this one student two.
And these computers aren't well they might be connect to the Internet so they get to Google.
But these guys are just if they want to transfer files or something like that.
So in this particular case we're using what's known as an interior DNS server so this DNS server can
use these weird domain names because he doesn't have to register it with the Internet and we use local.
That's kind of a convention it's a nicety we could type in cheez whiz if we wanted to there but we tend
to use the word dot local to show that it is an internal domain.
It's not for being used out on the Internet.
Now you need to think about this for a minute because this tends to confuse people a little bit because
I go oh wait a minute Mike I want to be able to get to WWW dot google dot com. Well, you can. Remember
that this DNS server he can go ahead and talk up through the hierarchy of DNS and get to resolving all
the Internet names.
But he also is going to be ready for the term the authoritative DNS server for this domain right here
to get this to happen.
We need to start up a DNS server and we're going to have to add a number of particular types of records.
We add records into what are known as Look-Up zones.
The primary type of zone we have is called a forward lookup zone and so we're going to set up a forward
lookup zone for classroom dot local.
In fact I already got that set up for you and then we're going to start adding records for all the different
types of computers that are within the actual domain.
There's a few more things to do but I think it might be more fun if we head over to the computer.
Let's actually try this for ourselves.
So for this demonstration I'm going to be using Windows Server 2016.
Keep in mind that I like this one because it's graphical and pretty but we can use any domain name server
to do the exact same thing.
So let's dive into Windows 2068.
Here's the DNS manager that's built into Windows 2016.
And you take a look right here you'll see that I have created: here's my forward look up zones.
This is part of the reason I like Windows it makes a nice little hierarchy it's easier for us to understand
what's going on.
So I've created a forward lookup zone called classroom dot local.
Now if you look in here ignore all this Microsoft garbage up here.
What I'm interested in is right here these are four records that we've already placed into this particular
forward lookup zone.
First of all is what we call the start of authority or SOA. The start of authority is the DNS server
who is the primary DNS server for this zone.
So if I wanted to I could have three or four DNS servers all for classroom dot local and if one of them
went down if people could get to another DNS server.
However with DNS there's always one big cheese.
And in this particular case this server that I'm running right now because he's the only one is the
start of authorities so if you look right here you'll see where it says SOA. Second are name servers.
You see this NS right here.
Remember I said we can have more than one domain name server.
And in this particular case every name server that is part of classroom dot local would be listed here.
In this case there's only one.
So and he's the same as the SOA which makes sense.
So one SOA one NS. From here there's a bunch of different types of records that we can put into
a forward lookup zone.
So let's just go ahead and start running through some of the more important ones.
Probably the most important of all is the A record that is your standard.
This is one person on this forward look up zone.
So what I want to do is add student 1.
So I'm going to add an A record
and I'll make up an IP address.
192 168 56 200.
And let's go ahead and make student two while we're in here.
OK so I've added two host records to my domain.
Now two questions come up.
A lot of times when people see this.
Number one they go Well Mike what if I'm using DHCP? You've just manually typed in IP addresses.
What if they change because of DHCP?
And the answer there is that DHCP can be programmed to work with DNS and as a matter of fact if I had
these two computers simply join the domain these records would have automatically been added.
So what I'm doing is I'm statically adding these.
I would do stuff like this for example if I've got a server or something like that I'd go ahead and
statically enter these and then that way I've got an A record. Now an A record is only for IPv4 but a
quadruple A [AAAA] record is for IPv6. So this time I'm going to go in and I'm going to pretend there's a student
3.
Now this time I'm not going to type in an IPv4 address.
I'm actually going to type in an IPv6 address. A very short one but it will get the idea.
And watch what happens now.
Now you'll see we have what's known as a quadruple A and that's only for IPv6. So an A record for IPv4,
quadruple A for IPv6.
One of the things we run into a lot is sometimes you're going to try to access a server like it's a
web server and everybody types in W W W when we type in a web server right.
Well you don't have to.
For example I could easily do for my total sem I could do Fred dot total sem dot com. We can do any kind of
we want but there's only one IP address.
So if we wanted to we could put separate A records in.
Probably not the best way to do it.
What we do instead is we would use the concept called canonical name.
What I'm going to do in this particular example is that student 1 I'm going to make a canonical name
which will still direct toward student 1.
Let me show you how this works.
So what we'll do is add a canonical name, CNAME, or alias.
And I'm just going to call it Fred.
And we're just going to point it to Student 1 dot classroom dot local.
There we go.
So all I've done here is if somebody gets on the network and they're looking for Fred they'll be pointed
straight towards
student 1.
This is a common thing you'll see done and a lot of offices where Bob's machine you know it's got its
own standard name all the time but you know while Bob's there we call it Bob's dot classroom dot local kind
of thing.
Canonical names are extremely common and we use them all the time.
OK.
Now the next one I want to talk about is probably one of the most important things we do with DNS and
that is a mail exchange or MX record.
All of our SMTP mail servers that are out there exchanging mail use DNS and they get their own special
host record called The MX record
so usually we have a dedicated server and usually call it mail very creative name there.
Now if I wanted to I could have it redirect or I'll just type in mail dot classroom dot local
and what I've done here is I've now created a mail exchanger.
This is how when your mail is being delivered when you upload a piece of mail your mail servers use
the DNS system to get the mail delivered to the right person.
Now this can be a bit of a challenge because it's really easy to spoof mail servers.
So one of the tricks that we do when it comes to helping get the spam down a little bit is we create
something called a reverse lookup zone. A reverse lookup zone doesn't go from qualified domain name to
IP address.
It says If I have an IP address give me a domain name.
It's a very easy way for if I get a request to send on 7000 pieces of mail I might want to go back say
you know what.
Let me double check the IP address.
So a reverse lookup zone does exactly the opposite of a forward lookup zone.
Now it's got a bit of a strange nomenclature so watch this.
So I have created a reverse lookup zone for classroom dot local.
First thing I want you to notice is look at that name right there do you see it.
It's actually the network ID backwards with this very specific in Dot addr dot arpa because that's the
way these guys set this up.
Now what they can do is that in essence we've got the network ID right here to help us look stuff up
so let's create a pointer record for that mail server
and we'll say that mail server's 202.
And you can see I've now created a pointer record for my mail server. Reverse look up zones are not supercritical
for most things.
One place they are pretty much required is if you're using mail servers.
I've seen a lot of little in-house networks where they don't even bother with the reverse lookup zone
because they don't need it.
The moment they drop in a mail server and they won't actually send mail around they put in that reverse
lookup zone.
So remember a reverse lookup zone will resolve an IP address to a fully qualified domain
name whereas a regular forward lookup zone you start with a fully qualified domain name and it hands you an IP
address.
All right.
So from here now we got just a couple of more specialized types of host you're going to run into.
First one I want to talk about is called a server record.
Here we.
This one is so unique I have to actually dig a little bit.
All right.
So this service location or SRV record.
There are times when I have certain types of services I'm trying to find a server that does something.
Now if we wanted to like mail the NX records they get their own dedicated host type.
But there are thousands of different services out there.
So the idea is look instead of making a unique type for every possible service that's out there we'll
make this SRV record.
And then you plug in whatever service you want.
These are very very popular with voice over IP systems and a few other situations. They are rare but
not so exclusively rare that we shouldn't talk about them for the network plus.
So let's just go through one example so here I'm going to create a pointer you can see it's got some
defaults in there but I don't trust these.
So I'm going to do one called sip which is a popular protocol for voice over IP.
And then I could just I could type in anything I want in here.
I'm just going to type sip now priority and wait.
These values don't really mean anything by themselves.
It depends on the service and how the service wants to use these.
For example if you've got a lot of incoming calls and you've got four sip servers for your voice over
IP you can set these two values for how you want the servers to be prioritized in order.
So usually if I only got one I'll do 10 and 10 and sip is 5 0 6 0 and then I type in the name of the
server providing this service.
In this case I would call it a sip
and you can see I've now created an S R V record.
Like I said SRV records are pretty rare you're going to have a specific type of service that requires
them and voice over IP is really really common for that type of situation.
All right.
So the last one I want to talk about is called a text record. Text records are kind of interesting.
Text records have been around for ever.
So what I can do here is I could just type in pretty much anything I want.
Text records for decades were how if I was setting up a DNS server
I would throw in a text record so that Janet,
the Tech who's coming in after me, I could say Hey Janet listen all of these A records from dot 10 to dot 40 need
to be deleted on the 15th.
So it was just a way for us to talk to each other.
However text records have suddenly got a lot more important in the anti-spam world.
There are two types of text records I want to talk about.
There's DKIM and SPF.
Now before I show it to you.
Let's have a little bit of fun.
Me setting up an in-house DNS server that's great for just a little windows network or something like
that.
But what if I have web servers up there that are actually on the Internet.
In that case we tend to move towards what I call an external DNS server. An external DNS server's a DNS
server that is registered on to the Internet.
It is trusted by other DNS servers and it allows us to register domains we can configure those domains
we can do anything we want to them.
So in this particular case I'm going to minimize this and I'm going to open up my web browser and I'm
going to let you take a little peek
at one of my external DNS server providers called name cheap. name cheap is famous for providing great
inexpensive and in some cases absolutely free DNS services.
The reason I'm bringing this one up in particular is because here are some examples of text records
that cover both SPF and DKIM.
So if you take a look here this is a text record for my total sem dot com.
And if you look in here you'll see it has an SPF, what it has in here more than anything else,
you'll notice there's an IP address.
You see that what the SPF record does is simply says look accept any e-mail that comes from this IP
address if it comes from any place else.
Forget about it.
So that's actually a very handy way so just total seminars folks can go ahead and use that e-mail server
to send out e-mail.
The other one or DKIM which is down here. DKIM is actually a key, it's a certificate and this certificate
allows us to be able to authenticate any individual person trying to use the e-mail as a legitimate
user.
So here they can do passwords and that type of stuff.
So textfiles have gone a long way from being regular little host records where we typed in Hey Janet
and are now absolutely critical in the world of anti-spam.
You would be hard pressed to find a place where you could set up an e-mail server anymore where you
didn't include both an SPF and DKIM record.
OK.
Now this is a bunch of different records that we've now seen for DNS.
I can't stress enough how important it is for the exam that you're very comfortable with
each one of these record types. Really the only thing you need to be looking at at this point in the
game is what are they for.
Mainly definitional stuff.
I will also tell you that you should take a chance and get on name cheap and open yourself up an account
and play with it a little bit.
I'm not I'm not a paid sponsor for name cheap.
I'm just telling you as a web site and an opportunity to have a place to play and discover how DNS works.
It's an absolutely great tool.