A playground for the boys
Today's special: Free domain name and DNSSEC!
Disclaimer: First article, hopefully my prose is not too bad. I’m sorry it’s a bit long. I decided to tell this short story, because I struggled a bit to correctly setup my EU.org domain name and I realized I was probably not the first in this situation. Enjoy!
I have always wanted to have my own domain and website to play with. One can easily find out it is possible to host a website with self-signed certificates for free, but I always believed domain names were a mandatory non-free step, and I eventually gave up and got a domain from G-company.
My friend Mcdostone introduced me to EU.org, which gives to people like you and me the opportunity to get our own domain names for free. This story describes the process I had to go through in order to get a fully working domain name with EU.org.
Menu
Prerequisites
I will not cover how to:
- run a web server on a local host;
- do port forwarding on your router;
- get free SSL certificates signed by a CA (check out certbot).
I am running a very simple Flask web server on a Raspberry PI 4, available at http://inteam.eu.org.
Request the domain name
First thing I had to do was to create an account. It is quick and simple, they ask for basic information that will be used later when requesting a domain name. They ask for a fax number (really?) and five address lines, and I unfortunately have only one. Felt discriminated but anyway.
After registering, I requested a domain name. Most of the fields were already filled, and I basically only had to choose my domain name. EU.org offers a lot of subdomains. Make sure you read EU.org policy to determine whether or not your project is compatible with their rules.
Domain's organization information.
A point to note here is the Name servers
form. I am not an expert, so I just
opted for their recommended option for correctness.
Finally, I added my domain name next to Name1
, and the public IP address
of my web server next to IP1
.
Third checkbox please!
I then submitted my request! The EU.org team manually (I guess?) reviewed and
eventually approved my request. It took a few days for me, less than two weeks
IIRC. Once I got notified my domain and the appropriate records had been
created, this is what my domains list looked like, at the exception of DNSSEC
:
My list of domain names.
Su-per. I’ve just got my first free domain name. It took a few days to spread across the DNS servers, as expected. I was regularly checking if my domain was yet resolved , and I eventually noticed a lot of DNS servers wound not resolve it. Why?
Configure DNSSEC
DNSSEC is basically a modification of the DNS protocol which improves its security by authenticating DNS exchanges, preventing spoofing. When I configured DNSSEC for my domain, I was still waiting for a response from the EU.org team, because I was surprised most of the DNS servers were still not resolving my domain name after three weeks. At this time, I did not know it would fix my issue.
I was a bit lost and started to browse around, looking for a way to add DS records to my domain. I was decided to ignore the warning from EU.org and to enable DNSSEC anyway on my domain.
All my homies hate warnings.
I eventually followed a tutorial1 which was very helpful, but I ran into a few errors which were not covered, so I will describe the full process here.
Setup a bind
server
The first task was be to install and run a DNS server. On my Raspberry, I had
to install the bind9
package, which is known to be the most used DNS server
ever. No less!
Now let’s enable DNSSEC:
sudo vim /etc/bind/named.conf.options
At this point, I forwarded my port 53 for both TCP and UDP protocols in my router configuration.
Generate and sign my keys
I want now to create two pairs of keys, the Zone Signing Key (ZSK) and the
Key Signing Key (KSK). For that, we will need the dnssec-tools
package.
I’m running Arch so I have used:
Once the toolkit was installed, let’s navigate to the directory where bind
looks for the keys:
Then I generated the ZSK and the KSK:
It created two .key
and two *.private
files, which are two sets of public/
private keys pairs. I need now to create a zone file, which is the file I
will sign. You will have to replace <IP>
, <EMAIL>
and the filenames with
your appropriate values.
Note: <EMAIL>
is the email I registered with when requesting the domain
name, but the @
symbol becomes a .
and all .
previous to the @
should be
escaped. And you also end it with a last .
. For instance:
exa.mple@example.eu.org
turns into exa\.mple.example.eu.org.
.
I could finally sign this fifth file, using dnssec-signzone
:
Note that we use a random salt here.
At this point, I needed to tell bind
to use the new file
example.eu.org.zone.signed
:
sudo vim /etc/bind/named.conf.local
I finally reloaded bind
service with sudo systemctl reload bind9
. I checked
if everything went fine using dig
:
Everything looked good so far.
Submit DS records
Now that my DNS server was running, I needed to give EU.org my public keys so it
could finally enable DNSSEC. Back to DNSSEC configuration of my domain, I added
my DS records. They are actually the last line of the *.key
files I generated
earlier:
All lines starting with `;` are comments and should be ignored.
The line with the 257
has to be the primary DS record, so I added it first.
and then the second one.
Again, it may take a few minutes for changes to take effect, but it looked like it had been instantly processed for me. As soon as I submitted these records, I checked again if major DNS servers were now resolving my domains:
After a month of big sad, big joy was here.
There are also tools like DNSViz to make sure DNSSEC has properly been enabled.
Avoid Zone Walking attacks
I’m not sure if this is really necessary but the article I followed considered
important to teach how to protect ourselves from Zone Walking attacks. From
what I understand, this attack is difficult but not impossible, and may allow
one to get unauthorized access to our resource records by requesting DNS servers
and by trying to revert hashes. To address this issue, it is recommended to
update the salt that we used when signing our zone file. This script
2 will automatically refresh the salt of our signed zone
file, and can easily be automated using cron
:
$ sudo crontab -e
Don't forget to chmod
this script!
This will refresh the salt every week for you.
End of the story
Thanks for reading this short story! I took me a bit of trial and errors to get there, but I really enjoyed tinkering with DNSSEC, and as always it feels good to learn something new. Now that my site is available for everyone, I gave access on my Raspberry to my friends and created them a user, so they can play with the website as they want.
The next story you don’t want to miss will probably be realized on Mcdostone’s blog! Cya <3
Resources
Here are all the documents that helped me through this: