blog.itcode.devblog.itcode.dev

[Raspberry Pi 4] Applying a Domain to the Raspberry Pi

Through the process so far, I've installed an OS on the Raspberry Pi and set up an environment where Tomcat runs as a web server. Now we can access the site by connecting to the Raspberry Pi's IP address. But a proper page isn't accessed by typing in an IP address. We'll acquire a domain, link it to the IP, and use it as the URL address. In this chapter, we purchase a domain directly and connect it to the Raspberry Pi server.

[Raspberry Pi 4] Applying a Domain to the Raspberry Pi

Through the process so far, I've installed an OS on the Raspberry Pi and set up an environment where Tomcat runs as a web server. Now we can access the site by connecting to the Raspberry Pi's IP address. But a proper page isn't accessed by typing in an IP address. We'll acquire a domain, link it to the IP, and use it as the URL address. In this chapter, we purchase a domain directly and connect it to the Raspberry Pi server.
RWB0104
@RWBwritten at 2021-09-04 03:09:04
Raspberry Pi

시리즈 모아보기

Raspberry Pi

4 / 7

Through the process so far, I've installed an OS on the Raspberry Pi and set up an environment where Tomcat runs as a web server.

Now we can access the site by connecting to the Raspberry Pi's IP address.

But a proper page isn't accessed by typing in an IP address. We'll acquire a domain, link it to the IP, and use it as the URL address.

In this chapter, we purchase a domain directly and connect it to the Raspberry Pi server.

In a previous post, I covered the process of getting a free domain through Freenom.

Free is fine, but Freenom is quite unsuitable for actual production use.

I thought about which TLD to use. Personally, I was drawn to the trendiness of the io domain, but based on Gabia's pricing, the domain cost is a whopping 200,000 KRW per year... Since I didn't strictly need io, I thought it was too inefficient to burn 200,000 a year.

I originally intended to go with the popular com, but while researching I found there was a developer-flavored domain called dev, so I decided to go with that.

I decided to buy from Google Domains, where the standard price is $12.


Naming is always the hardest part of anything. It's true when deciding a game character's nickname, and it's true when naming variables.

Like the famous domain socket.io, I wanted to create a domain that reads like a sentence, using dev cleverly.


Some words carry a premium price, and even among premium domains, the price varies depending on how unique the word is.


That said, if a word is too generic, it also gets marked up as a premium... For example, unix.dev hasn't even been claimed yet despite containing the common noun "unix," yet the premium price is over $1,000. webapps.dev is likewise very expensive.

But phrases made by combining multiple words seem to be less recognized as premium, so if you dig around, you can sometimes find a pretty decent domain without a premium price tag.

After much deliberation, my final candidates were as follows.

  • itcode.dev
  • mustdo.dev
  • imnow.dev

None of the three carried a premium, and each captures a developer-ish feel as much as possible. I originally intended to go with mustdo.dev, but I switched to itcode.dev at the last minute because of how clean it looked.

There are various sites where you can get a domain, but this chapter explains the process based on Google Domains.

The reason is simply because it's Google.

  • A server
  • A payment method that supports overseas payments

The above is what I needed when getting my domain.

If you pay through a domestic site instead of Google Domains, you don't need to worry about overseas payments. Since Google is an overseas service, you need to be able to make overseas payments.

Search for the domain you want.

Once you've chosen a domain, click the [cart] button in the middle right to add it to your cart.

Some domains, such as the dev domain, have the More secure policy applied, which enforces SSL.

Keep in mind that domains with this policy applied cannot serve HTTP and must serve HTTPS only.

If this is your first payment, you need to select the currency you'll pay in.

Unfortunately, Korean won isn't supported, so choose one of the supported currencies.

In this chapter, we proceed based on the dollar ($).

For overseas payments, dollars are advantageous in terms of fees
After finishing my military service, I briefly worked at a card company call center. One thing I learned there is that overseas payments are converted based on the dollar. If you pay from KRW to EUR, for example, in reality the conversion happens twice, KRW → USD → EUR, so the fee is also charged twice.
The same applies when paying in KRW while abroad. Paying in KRW with a domestic card overseas goes through the bizarre mechanism of KRW → USD → KRW, so for overseas payments, it's simplest to just pay in dollars.

If this is your first payment, you'll be asked to enter domain owner information. Fill it in appropriately.

For the ZIP code, it only accepts a US ZIP code, so just search Google for any random US address and use one of its ZIP codes.

Complete the domain purchase.

[Read trademark notice] asks you to agree to related terms because the domain uses the brand name "starcraft."

This step doesn't exist for a normal domain.

  • Registration - Select the ownership period (minimum 1 year)
  • Privacy protection is on - Hides the domain owner's information. When looking up domain info via WHOIS, etc., the owner's information will be hidden.
  • Auto-renew is on - Enables automatic domain renewal
  • Custom email - Enables a domain email account

Custom email is for creating a Google email account under your own domain. In other words, it's a service that generates an email ID using the domain you purchased, like example@starcraft.dev.

Of course it's not free — it costs 12peruserpermonth.Consideringthedomainmaintenancecostis12 per user per month. Considering the domain maintenance cost is 12/year, that's 10 times the cost. Unless it's necessary for business purposes, uncheck this service.

Once the domain purchase is complete, a purchase receipt and guide email are sent to the email entered in the owner's information.

The domain is usable immediately after purchase. To connect this domain to the Raspberry Pi, all you need to do is configure DNS to link the Raspberry Pi's IP with the domain.

You can manage DNS settings from the DNS menu in Google Domains.

Click [Manage custom records] to add a DNS record.

Add an A record and enter the Raspberry Pi's IP as the data, then save. Propagation completes within a few minutes.

Entering a private IP? Stop right there!
If you're using a router, checking your IP will output a private IP like 192.168.0.xxx. The A record must contain the actual public IP, not a private one. You can check it in your router settings or on findIP.

BASH

nslookup [domain]

Whether on Windows or Ubuntu, entering the above command lets you check the IP linked to the domain.

If the IP you entered comes back correctly, it's a success.

Start Tomcat on the Raspberry Pi and visit example.com:8080 to check whether the page loads correctly.

  • Check whether xxx.xxx.xxx.xxx:8080 connects
  • If it connects, that means external access is working fine, so check whether the IP linked to the domain is correct
  • If it doesn't connect, that means external access itself isn't working, so check whether there's an issue with the firewall or port communication
  • If you're on a router, check whether port forwarding is configured for the IP address
  • Set up an Ubuntu server on the Raspberry Pi.
  • Run Tomcat to host pages.
  • Apply a domain.
  • Provide HTTPS communication by issuing an SSL certificate.
  • Set up remote communication environments such as SSH and RDP.
  • Install MariaDB to handle DB communication.

The dev domain requires SSL. What's more, since virtually every website deployed nowadays essentially forces HTTPS adoption, I'm adding HTTPS support to the goals.

# Raspberry Pi# Ubuntu# Domain
ship
blog.itcode.dev

Notes from the π-th Alpaca

7.0.1
Developed by RWB since 2021.057th upgraded at 2026.08