Check out a free preview of the full Full Stack for Front-End Engineers, v3 course

The "Buying a Domain Name" Lesson is part of the full, Full Stack for Front-End Engineers, v3 course featured in this preview video. Here's what you'd learn in this lesson:

Jem discusses some restrictions when purchasing domain names, demonstrates how to purchase a domain name through Namecheap, and how to connect that domain to the previously created droplet on Digital Ocean.


Transcript from the "Buying a Domain Name" Lesson

>> Yes, Mark.
>> With the domain name, are there other things offered like SSL, hosting, etc, or do I need to get it? Or are there any add-ons or things?
>> So we're gonna use Namecheap for our domains, we're gonna use Namecheap even though the UI is just okay.

We're using them cuz they have a lot of functionality built in. So if you want SSL, you want email hosting, you can do all that via Namecheap, they don't try to push you too hard. Originally, I tried to use the Google Domains, cuz I'm like, Google, things like, or, I forget which one.

So I went through, I bought a domain with them, one, it was more expensive than Namecheap. Two, they really were trying to upsell me the whole way, which I really don't like. You already know my stance on ads and privacy, I have a strong stance on being upsold on things as well.

So we use Namecheap because it's gonna give you the cheapest domain name possible. There might be something like or something like that which maybe a little cheaper. But Namecheap's gotta have the biggest selection at the cheapest prices. And there's another question about country level top domains, who owns them?

Generally, something like, .ru comes to mind. Russia owns the .ru domain name, they've registered that with ICANN. Most countries own their own domain names, that's not always the case. Because the country can sell away the rights to their domain for money. I've tried think of some examples from the earlier days of the Internet, but there's like some country, .io.

You all remember a couple years ago the explosion of, every startup and tech company had .io company name or .ly company name? It was and and all these other things. Yeah, that was a trend that went away, I don't know what happened to that. But the .ly domain name is actually a country TLD owned by somebody, some small island nation.

I think they sold it, or they made a bunch of money from that, .ly, just because it happened to rhyme, or go well with the English language. So countries generally own them, not necessarily. The other one is, there are reserved domain names that you cannot get. So .org, the only way to get a .org is to be a registered organization.

So generally, maybe a nonprofit or something like that. I can't just say like, I have to actually be a 501(3)(c) nonprofit or something like that. The other one is .edu, you have to be a legitimate educational institute to have a .edu domain name. Another one comes to mind is .gov, you can't get a .gov domain name, that kinda makes sense.

Only legitimate government entities can do that, .mil, .military, you can only get if you're part of the military. So there are restricted domain names that you may see that aren't available besides the ones that are owned by corporations. But don't get distracted, once we go to Namecheap, you will see how many possible TLDs there are.

And you probably won't be able to think of funny names for all of them. So I'm gonna jump to And what sort of domain name do I have? I really should plan this ahead of time. I put 100 plus hours in this course, and I didn't bother thinking of a funny domain name.

I'm stuck here.
>> If it helps, I'm gonna register
>> [LAUGH]
>> Because that brings me back to my college days.
>> So someone's gonna register, that's pretty good.
>> Someone registered at Google to the
>> [LAUGH]
>> [LAUGH] All right,, I wish I bought fullstack.

All right, you do not need any services, SSL, we're gonna do that ourselves and we're gonna do it for free. So you don't need any of this stuff. Business email, I will show you how to set up email forwarding, just nice to have with domain, it's pretty sweet.

All right, so I'm gonna check out, I already have an account with Namecheap and my cart, so I'm just gonna check out. Blah, domain privacy, sure, confirm my order. We see here with the registration, remember we talked about ICANN? We pay them a fee every time we buy a domain or renew it, it helps keep the nameservers alive, helps keep it running.

I'm just gonna buy it. Important thing on Namecheap or any other registrar, so Namecheap is known as the registrar at Google Domains. Any sort of domain hosting are known as registrar's because they register your domain to yourself as the owner. You always want a strong password, you always want two-factor authentication.

There have been times in the past where people have stolen people's credentials. And suddenly, goes somewhere else entirely different. And imagine the chaos there, because it's very easy to clone a webpage and make it look legit. And then make a login page, and then you're just stealing everybody's logins really easily.

Hence, you always want security around your domain to be very limited to a subset of people and very, very, very tight. Okay, so I have secretly put in my credit card information, everybody in the room knows my credit card. Seeing some unusual purchase activity already, but that's okay, we'll just recharge it later.

So I've bought a domain name, I bought, which, following the rules of a domain name, it needs to be funny or memorable, preferably both. So now we're into the domain management screen. So if you need to get to here in Namecheap, you just go to your domains list here, you can see all the domains that I own, I told you.

I should have just kept one of these, like, it cost me $70 a year to maintain this. And I don't do anything with it, I just bought it cuz I was like, someday I'll do something with it,, why do I own these? Really dashboard, anyways, we won't go into the issues with domain squatting and things like that.

So we're gonna go to, and I'm gonna to Manage. Okay. All right, so you've probably gotten this far before, most engineers I know own some sort of domain. But now it's the part where we actually hook it up to something. This is the missing link for a lot of people, I know it was initially for me.

So let's check out what the slides have to say for our next steps. So we're gonna buy a domain with a registrar. Again, you don't have to use Namecheap, they just happen to have the cheapest domain names for educational purposes or for fun. Then we're gonna update the nameserver, remember we said who the nameservers were?

That giant kinda phone book mapping names to IP addresses? So we're gonna move those name servers over to DigitalOcean, which will make it a little bit easier to manage. We can leave it with Namecheap, it doesn't really matter. But for this exercise, let's just switch over to DigitalOcean cuz I want you to have that experience of moving your nameserver.

And then once we update our nameserver, we're going to go in DigitalOcean instead of Namecheap and we're gonna add two A records. And remember what we said A records where? They map domains to IPs. So we're gonna add one for the @, the @ is just your domain name.

So in this case, mine would be, that's the @, it always represents the root. Dub dub dub, www, it's not considered a subdomain, but it's generally the convention, World Wide Web. Not a phrase we use a lot these days, but it exists by convention. So I want to work on both and, depending on how you navigate it.

So let's go ahead, and first thing we're gonna do, we're gonna update our nameservers. So click on your droplet, then click on the three dots and say Add a domain. So we can do this first, we can do it after, it doesn't really matter, let's do the nameservers first.

So the nameservers are just,,, and they're somewhere in here. I usually have them listed out, I forget where, but I'll find it in a second, but they're pretty easy to remember. So back in Namecheap, under our Domain Management page, we're gonna go all the way down to nameservers.

And we're gonna say Custom DNS, and the name server for DigitalOcean, And I'm gonna copy paste cuz I don't wanna type in the wrong thing. And we wanna add all three, so ns2, ns3. And all this is saying is Namecheap is a registrar, they say, hey, I own

It's registered to me personally, my address, I'm the one in charge of renewing it, things like that. However, I'm gonna move my actual DNS management over to Digital Ocean, using their nameservers. That means Digital Ocean will be the authoritative answer as far as where the domain actually goes.

So I'm gonna say Save, it may take a second to propagate some of these changes. Because again, there's a whole bunch of registrars and nameservers. It can take anywhere up to a couple minutes for the changes to propagate across the Internet. And I didn't do it because I moved my redirect email, but I'll show you on a different domain how to have some fun.

So I'll pick, again, a great domain name, but I haven't done anything with it, I also moved that to Digital Ocean. Let me pick a random one that I know, let's see, I'll pick I really just need to drop these, I don't know why I'm paying for these.

I'm sure everybody says that every year. So on Namecheap, a cool thing you can do is you can make an alias for all of your email addresses. So if I wanna make, I don't know,, I can do that, so I can put a wildcard here. Put a catch-all, actually, and I can just forward it to myself at one of my email addresses, So now I can send any traffic, I can't write emails using this because it's just a forward.

But what I like to do, and this is one of my favorite things to do, is if I'm using a product or service, I say, for instance, like my personal domain name,, I just say I'm on That way I know if I ever get spams where all these things are coming from, and I can wildcard it all.

If I wanna sign up for Frontend Masters, I can say And I have all these custom email addresses that just forward to my personal one. Now, you can't send email addresses with a forwarder, that you have to pay for, which is possible, it's not too expensive. And that way you can have your own private domain, your own private email, it makes you look professional when you own or something like that.

But if you just want to do forwarding, it's free, and it's a pretty fun way of catching spam or just making life a little bit more interesting. I will say this, people are not as technology adept, they sometimes get suspicious. I use one, it was like, like, do you work for this bank?

And I'm ending the bank, so don't call my bank, but I was like, no, that's just a forwarding address, they're like, okay. And they really gave me, is this a hacker, man? So be careful, that's actually happened to me a few times. If I use the company name at, they get really suspicious.

Then I have to explain email forwarding and that's the whole thing, but it's worth it to have a custom domain name. Okay, so now that those changes have hopefully propagated out on the Internet, we can add domain names to Digital Ocean now. So I'm gonna say And we're gonna add that domain, and we're gonna map it to my droplet here.

Remember, I only had one droplet, if you made more than one, make sure you pick the right one. So we're gonna add that domain here, and of course, we can't just add it, we need to add a record. So remember we said the @ was the root? So that's just, and we're gonna pick, is this the right one?

See, this way you don't have too many droplets. That's the right one, is it the right one? Let me double check. Scroll up to my actual IP address cuz I'm lazy, yes, it ends in 128.44, okay, so this is the right one. So we're gonna create an A record, and then we'll create another one for www, and we're gonna map it to our droplet again.

And then we're gonna create another record. Okay, everybody there with me? One small step for you, one giant leap for your web application. And at this point, if you've done everything right, we have connected our random domain to our random server using the power of Internet, DNS, and nameservers.

But if I go to, nothing, cuz our server doesn't do anything yet. So it doesn't know how to respond to any requests to that query. But using our network tools, let us validate, let's see what the nameservers have done, maybe they haven't propagated fully yet. So we'll say dig, And it's not available yet, again, these changes can take time.

So in the meantime, if it still hasn't happened for some reason, because vagaries of the Internet, we can always just use our IP address for now instead of our domain name. Let me try nslookup, I don't know if that will tell me something different. Yeah, so the changes haven't propagated fully yet, it can take time, yes.

>> What service do you use to send emails from your domain?
>> I think Namecheap, depending on who you're using to manage your nameserver, you can just buy a service, Namecheap will have it. I forget how much it costs, I know Google, you can do with Google as well, if you wanna hand them control of your domain.

So what will happen if you wanna do Gmail forwarding, or have a Gmail address with your domain. You have to hand, not control, but you need to move the nameserver over to Google Domains, just like we did with DigitalOcean. Then that way they can manage the DNS system, and then you can do email forwarding.

I think DigitalOcean will allow it too, that's usually a service you have to pay for. If you just want to do email forwarding, that's free, you can do that for free. But if you wanna send that email back out, that costs money. And here there's a button to buy a private email for your domain name if you need.

And if you need to transfer it to a different registrar, you would go to Sharing & Transfer. They usually make this pretty difficult, because, obviously, I don't want someone buying randomly because they felt like it, yeah.
>> I think Namecheap does, with the private email at least, back with one of my other domains, they do integrate with Google Workspace, or it used to be Google Apps for Business.

But if you want that Gmail feel and Google Drive and everything, you just click a couple buttons and they configure the DNS in Namecheap. And they'll bill you for the Google account through your Namecheap account.
>> Nice, did not know that. So for those who couldn't hear, Namecheap will hook up your domain to Google Drive and Gmail if you need, and they'll hook it all for you.

I do like Namecheap, the UI may be a bit much, it's a little clunky, maybe more information than you need for most cases, but they are the cheapest and they're pretty reliable. I've used them for well over a decade now and haven't had any issues.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now