SlideShare a Scribd company logo
1 of 16
Download to read offline
SFScon 2022
Manage your own DNS
Dashamir Hoxha
dashohoxha@gmail.com
How to manage your own DNS
When you purchase a domain, the seller of the domain usually
offers the possibility to manage the DNS records of this domain
from a web interface. In this case you are using their nameservers.
However it is also possible to manage your domains yourself, and it
is not too difficult. In this presentation I will show how I do it.
How DNS works
Let’s see how a client (browser) finds the IP for cloud.example.org
➢ Contact a root nameserver and ask it which servers are
responsible for managing the top-level domain .org
➢ From the query on the first step the client gets a list of the
servers responsible for the domain .org, it can ask any of
them for the servers that are responsible for the
subdomain example.org
➢ From the query on the previous step it will get a list of
nameservers for the domain example.org, for example:
○ ns1.example.org
○ ns2.example.org
➢ Ask any of these nameservers for the IP of the server
cloud.example.org
How DNS works
Let’s try these steps manually for the domain ocw.fs.al
1. Get the root nameservers:
dig NS .
dig NS . +short
m.root-servers.net.
b.root-servers.net.
c.root-servers.net.
. . . . .
2. Get the nameservers of .al:
dig NS al @m.root-servers.net.
dig NS al +short
rip.psg.com.
nsx.nic.al.
ns1.nic.al.
munnari.oz.au.
3. Get the nameservers of .fs.al:
dig NS fs.al @nsx.nic.al.
dig NS fs.al +short
puck.nether.net.
ns0.1984.is.
ns2.afraid.org.
4. Get the address of ocw.fs.al:
dig A ocw.fs.al +short
5.45.111.246
Keeping nameservers synchronized
★ All the public nameservers get their
records from the primary NS, which is
hidden behind a firewall.
★ Only secondary NSs answer queries
from the clients, not the primary.
★ When there are any changes on the
records of the primary NS, it sends a
notification to the secondary ones.
★ Secondary nameservers send a
synchronization request (AXFR) to the
primary one
★ Upon receiving the list of new records,
they replace the old list of records with
the new one.
DNS Setup: Find secondary NS services
Instead of building and maintaining our own secondary nameservers, we
can use services that are available either for free or for a small price.
● https://www.buddyns.com/activation/
● https://1984hosting.com/product/freedns/
● https://puck.nether.net/dns/
● https://freedns.afraid.org/
Note: The "primary/secondary" nameservers are also called
"master/slave".
DNS Setup: Install the primary nameserver
The primary nameserver will be installed in an NSD container.
1. Install docker-scripts:
apt install git make m4 highlight
git clone https://gitlab.com/docker-scripts/ds
/opt/docker-scripts/ds
cd /opt/docker-scripts/ds/
make install
2. Install an NSD container:
ds pull nsd
ds init nsd @nsd
cd /var/ds/nsd/
vim settings.sh
ds make
DNS Setup: Make sure that port 53 is free
The NSD container needs access to the port 53 of the host: lsof -i :53
We should prevent systemd-resolved from using port 53:
1. Edit /etc/systemd/resolved.conf:
[Resolve]
DNS=8.8.8.8
DNSStubListener=no
. . . . .
2. Create a symbolic link:
ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
3. Reboot the system
4. Check that port 53 is now free: lsof -i :53
5. Try again: ds make
DNS Setup: Customize secondary nameservers
On settings.sh, edit the constants SECONDARY_NS and AXFR_SERVERS.
Then run again: ds make
SECONDARY_NS="
ns0.1984.is
puck.nether.net
ns2.afraid.org
"
AXFR_SERVERS="
93.95.224.6
204.42.254.5
69.65.50.192
108.61.224.67
116.203.6.3
. . . . .
“
Manage domains: Add a domain
Let’s say that we have purchased the domain example.org
1. Set the nameservers of the domain (what is on SECONDARY_NS):
ns0.1984.is
puck.nether.net
ns2.afraid.org
2. Add the domain to each secondary NS service
https://www.buddyns.com/
https://1984.hosting/product/freedns/
https://puck.nether.net/dns
https://freedns.afraid.org/secondary/
3. Add a zone on the primary nameserver:
cd /var/ds/nsd/
ds zone add example.org
Manage domains: Modify DNS records
1. Edit zones/example.org.db and modify the records:
cd /var/ds/nsd/
vim zones/example.org.db
2. Don’t forget to change the serial number too:
2022061901 ; serial
3. Notify the secondary nameservers that there are some updates:
ds notify
Alternatively, a ds restart will also reload the zones and send
notifications to the secondary nameservers.
Manage domains: Remove a domain
1. Remove it from each secondary nameserver service.
2. Remove its configuration on the primary server:
cd /var/ds/nsd/
ds zone rm example.org
3. Alternatively, disable its configuration:
ds zone dis example.org
Troubleshooting
1. We can make some simple checks and tests like this:
ds check --config
ds check --zones
2. To check the AXFR response for a domain:
ds zone test example.org
It will actually list all the records that will be sent to a secondary nameserver.
3. For further troubleshooting, we can get a shell inside the container and try
commands like these:
systemctl restart nsd
systemctl status nsd
tail /var/log/syslog -n 30
dig @localhost AXFR example.org
ufw status
Maintenance: Migrate the primary nameserver
To migrate the container of the primary nameserver to another host:
1. Transfer (with scp or rsync) the content of /var/ds/nsd/ from the old host
to the new one.
2. On the new host, rebuild the container:
ds pull nsd
cd /var/ds/nsd/
ds make
3. The public IP of the master nameserver has been changed (to the IP of the new
host), so we should update it on the configuration of each secondary
nameserver, for each domain.
4. Replace the old IP with the new one on each zone file as well, then update the
serial numbers and notify the secondary nameservers.
Maintenance: Modify secondary nameservers
If you need to modify the list of secondary nameservers, for example add
ns1.1984.is on the list, or remove one from the list, you should also make sure to
update these things:
1. For each domain that you manage, go to the website of the provider of the
domain and update the list of the nameservers.
2. If you are adding a new secondary nameserver, go to the website of the
nameserver and make sure that you add there all the domains that you manage,
along with the public IP of the primary nameserver.
3. On the primary nameserver, update settings.sh accordingly and then run
ds make
to update the configuration files.
Thank you for your attention!
Any questions or comments?
➔ Dashamir Hoxha (dashohoxha@gmail.com)
➔ https://docker-scripts.gitlab.io/dns.html (Tutorial)
➔ https://events.fs.al/event/8/registrations/ (Workshop)
Tutorial: Workshop:

More Related Content

Similar to SFScon 22 - Dashamir Hoxha - Manage your own DNS.pdf

DNS and Troubleshooting DNS issues in Linux
DNS and Troubleshooting DNS issues in LinuxDNS and Troubleshooting DNS issues in Linux
DNS and Troubleshooting DNS issues in LinuxKonkona Basu
 
Question 1 Refer to the graphic above to answer the following .docx
Question 1 Refer to the graphic above to answer the following .docxQuestion 1 Refer to the graphic above to answer the following .docx
Question 1 Refer to the graphic above to answer the following .docxIRESH3
 
DNSPresentation.pptx
DNSPresentation.pptxDNSPresentation.pptx
DNSPresentation.pptxKailashTayde
 
02 configuring and-troubleshooting-dns
02 configuring and-troubleshooting-dns02 configuring and-troubleshooting-dns
02 configuring and-troubleshooting-dnsapshirame
 
1. primary dns using bind for a and cname record for ipv4 and ipv6
1. primary dns using bind for a and cname record for ipv4 and ipv61. primary dns using bind for a and cname record for ipv4 and ipv6
1. primary dns using bind for a and cname record for ipv4 and ipv6Piyush Kumar
 
DNS windows server(2008R2) & linux(SLES 11)
DNS windows server(2008R2) & linux(SLES 11)DNS windows server(2008R2) & linux(SLES 11)
DNS windows server(2008R2) & linux(SLES 11)Tola LENG
 
Zone in windows server 2012
Zone in windows server 2012Zone in windows server 2012
Zone in windows server 2012devil00dante
 
DNS Configuration
DNS ConfigurationDNS Configuration
DNS ConfigurationVinod Gour
 
DNS_Tutorial 2.pptx
DNS_Tutorial 2.pptxDNS_Tutorial 2.pptx
DNS_Tutorial 2.pptxviditsir
 
Linux Administration Tutorial | Configuring A DNS Server In 10 Simple Steps |...
Linux Administration Tutorial | Configuring A DNS Server In 10 Simple Steps |...Linux Administration Tutorial | Configuring A DNS Server In 10 Simple Steps |...
Linux Administration Tutorial | Configuring A DNS Server In 10 Simple Steps |...Edureka!
 
Integration of neutron, nova and designate how to use it and how to configur...
Integration of neutron, nova and designate  how to use it and how to configur...Integration of neutron, nova and designate  how to use it and how to configur...
Integration of neutron, nova and designate how to use it and how to configur...Miguel Lavalle
 
Linux networking commands
Linux networking commandsLinux networking commands
Linux networking commandsSayed Ahmed
 

Similar to SFScon 22 - Dashamir Hoxha - Manage your own DNS.pdf (20)

6425 b 10
6425 b 106425 b 10
6425 b 10
 
Linux Addministration
Linux AddministrationLinux Addministration
Linux Addministration
 
Domain Name Service
Domain Name ServiceDomain Name Service
Domain Name Service
 
DNS and Troubleshooting DNS issues in Linux
DNS and Troubleshooting DNS issues in LinuxDNS and Troubleshooting DNS issues in Linux
DNS and Troubleshooting DNS issues in Linux
 
Question 1 Refer to the graphic above to answer the following .docx
Question 1 Refer to the graphic above to answer the following .docxQuestion 1 Refer to the graphic above to answer the following .docx
Question 1 Refer to the graphic above to answer the following .docx
 
15 Setup BIND 9
15 Setup BIND 915 Setup BIND 9
15 Setup BIND 9
 
DNSPresentation.pptx
DNSPresentation.pptxDNSPresentation.pptx
DNSPresentation.pptx
 
2_Chapter 2_DNS.pptx
2_Chapter 2_DNS.pptx2_Chapter 2_DNS.pptx
2_Chapter 2_DNS.pptx
 
Rhel4
Rhel4Rhel4
Rhel4
 
Linux04 dns 2
Linux04 dns 2Linux04 dns 2
Linux04 dns 2
 
02 configuring and-troubleshooting-dns
02 configuring and-troubleshooting-dns02 configuring and-troubleshooting-dns
02 configuring and-troubleshooting-dns
 
1. primary dns using bind for a and cname record for ipv4 and ipv6
1. primary dns using bind for a and cname record for ipv4 and ipv61. primary dns using bind for a and cname record for ipv4 and ipv6
1. primary dns using bind for a and cname record for ipv4 and ipv6
 
DNS windows server(2008R2) & linux(SLES 11)
DNS windows server(2008R2) & linux(SLES 11)DNS windows server(2008R2) & linux(SLES 11)
DNS windows server(2008R2) & linux(SLES 11)
 
Zone in windows server 2012
Zone in windows server 2012Zone in windows server 2012
Zone in windows server 2012
 
DNS Configuration
DNS ConfigurationDNS Configuration
DNS Configuration
 
DNS_Tutorial 2.pptx
DNS_Tutorial 2.pptxDNS_Tutorial 2.pptx
DNS_Tutorial 2.pptx
 
Linux Administration Tutorial | Configuring A DNS Server In 10 Simple Steps |...
Linux Administration Tutorial | Configuring A DNS Server In 10 Simple Steps |...Linux Administration Tutorial | Configuring A DNS Server In 10 Simple Steps |...
Linux Administration Tutorial | Configuring A DNS Server In 10 Simple Steps |...
 
Integration of neutron, nova and designate how to use it and how to configur...
Integration of neutron, nova and designate  how to use it and how to configur...Integration of neutron, nova and designate  how to use it and how to configur...
Integration of neutron, nova and designate how to use it and how to configur...
 
Dns
DnsDns
Dns
 
Linux networking commands
Linux networking commandsLinux networking commands
Linux networking commands
 

More from South Tyrol Free Software Conference

SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...
SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...
SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...South Tyrol Free Software Conference
 
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...South Tyrol Free Software Conference
 
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data Hub
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data HubSFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data Hub
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data HubSouth Tyrol Free Software Conference
 
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...South Tyrol Free Software Conference
 
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...South Tyrol Free Software Conference
 
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...South Tyrol Free Software Conference
 
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelines
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelinesSFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelines
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelinesSouth Tyrol Free Software Conference
 
SFSCON23 - Charles H. Schulz - Why open digital infrastructure matters
SFSCON23 - Charles H. Schulz - Why open digital infrastructure mattersSFSCON23 - Charles H. Schulz - Why open digital infrastructure matters
SFSCON23 - Charles H. Schulz - Why open digital infrastructure mattersSouth Tyrol Free Software Conference
 
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...South Tyrol Free Software Conference
 
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...South Tyrol Free Software Conference
 
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free software
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free softwareSFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free software
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free softwareSouth Tyrol Free Software Conference
 
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...South Tyrol Free Software Conference
 
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changer
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changerSFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changer
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changerSouth Tyrol Free Software Conference
 
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...South Tyrol Free Software Conference
 
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation Internet
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation InternetSFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation Internet
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation InternetSouth Tyrol Free Software Conference
 
SFSCON23 - Davide Vernassa - Empowering Insights Unveiling the latest innova...
SFSCON23 - Davide Vernassa - Empowering Insights  Unveiling the latest innova...SFSCON23 - Davide Vernassa - Empowering Insights  Unveiling the latest innova...
SFSCON23 - Davide Vernassa - Empowering Insights Unveiling the latest innova...South Tyrol Free Software Conference
 

More from South Tyrol Free Software Conference (20)

SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...
SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...
SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...
 
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...
 
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data Hub
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data HubSFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data Hub
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data Hub
 
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...
 
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...
 
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...
 
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelines
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelinesSFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelines
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelines
 
SFSCON23 - Christian Busse - Free Software and Open Science
SFSCON23 - Christian Busse - Free Software and Open ScienceSFSCON23 - Christian Busse - Free Software and Open Science
SFSCON23 - Christian Busse - Free Software and Open Science
 
SFSCON23 - Charles H. Schulz - Why open digital infrastructure matters
SFSCON23 - Charles H. Schulz - Why open digital infrastructure mattersSFSCON23 - Charles H. Schulz - Why open digital infrastructure matters
SFSCON23 - Charles H. Schulz - Why open digital infrastructure matters
 
SFSCON23 - Andrea Vianello - Achieving FAIRness with EDP-portal
SFSCON23 - Andrea Vianello - Achieving FAIRness with EDP-portalSFSCON23 - Andrea Vianello - Achieving FAIRness with EDP-portal
SFSCON23 - Andrea Vianello - Achieving FAIRness with EDP-portal
 
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...
 
SFSCON23 - Stefan Mutschlechner - Smart Werke Meran
SFSCON23 - Stefan Mutschlechner - Smart Werke MeranSFSCON23 - Stefan Mutschlechner - Smart Werke Meran
SFSCON23 - Stefan Mutschlechner - Smart Werke Meran
 
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...
 
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free software
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free softwareSFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free software
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free software
 
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...
 
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changer
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changerSFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changer
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changer
 
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...
 
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation Internet
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation InternetSFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation Internet
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation Internet
 
SFSCON23 - Edoardo Scepi - The Brand-New Version of IGis Maps
SFSCON23 - Edoardo Scepi - The Brand-New Version of IGis MapsSFSCON23 - Edoardo Scepi - The Brand-New Version of IGis Maps
SFSCON23 - Edoardo Scepi - The Brand-New Version of IGis Maps
 
SFSCON23 - Davide Vernassa - Empowering Insights Unveiling the latest innova...
SFSCON23 - Davide Vernassa - Empowering Insights  Unveiling the latest innova...SFSCON23 - Davide Vernassa - Empowering Insights  Unveiling the latest innova...
SFSCON23 - Davide Vernassa - Empowering Insights Unveiling the latest innova...
 

Recently uploaded

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 

Recently uploaded (20)

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 

SFScon 22 - Dashamir Hoxha - Manage your own DNS.pdf

  • 1. SFScon 2022 Manage your own DNS Dashamir Hoxha dashohoxha@gmail.com
  • 2. How to manage your own DNS When you purchase a domain, the seller of the domain usually offers the possibility to manage the DNS records of this domain from a web interface. In this case you are using their nameservers. However it is also possible to manage your domains yourself, and it is not too difficult. In this presentation I will show how I do it.
  • 3. How DNS works Let’s see how a client (browser) finds the IP for cloud.example.org ➢ Contact a root nameserver and ask it which servers are responsible for managing the top-level domain .org ➢ From the query on the first step the client gets a list of the servers responsible for the domain .org, it can ask any of them for the servers that are responsible for the subdomain example.org ➢ From the query on the previous step it will get a list of nameservers for the domain example.org, for example: ○ ns1.example.org ○ ns2.example.org ➢ Ask any of these nameservers for the IP of the server cloud.example.org
  • 4. How DNS works Let’s try these steps manually for the domain ocw.fs.al 1. Get the root nameservers: dig NS . dig NS . +short m.root-servers.net. b.root-servers.net. c.root-servers.net. . . . . . 2. Get the nameservers of .al: dig NS al @m.root-servers.net. dig NS al +short rip.psg.com. nsx.nic.al. ns1.nic.al. munnari.oz.au. 3. Get the nameservers of .fs.al: dig NS fs.al @nsx.nic.al. dig NS fs.al +short puck.nether.net. ns0.1984.is. ns2.afraid.org. 4. Get the address of ocw.fs.al: dig A ocw.fs.al +short 5.45.111.246
  • 5. Keeping nameservers synchronized ★ All the public nameservers get their records from the primary NS, which is hidden behind a firewall. ★ Only secondary NSs answer queries from the clients, not the primary. ★ When there are any changes on the records of the primary NS, it sends a notification to the secondary ones. ★ Secondary nameservers send a synchronization request (AXFR) to the primary one ★ Upon receiving the list of new records, they replace the old list of records with the new one.
  • 6. DNS Setup: Find secondary NS services Instead of building and maintaining our own secondary nameservers, we can use services that are available either for free or for a small price. ● https://www.buddyns.com/activation/ ● https://1984hosting.com/product/freedns/ ● https://puck.nether.net/dns/ ● https://freedns.afraid.org/ Note: The "primary/secondary" nameservers are also called "master/slave".
  • 7. DNS Setup: Install the primary nameserver The primary nameserver will be installed in an NSD container. 1. Install docker-scripts: apt install git make m4 highlight git clone https://gitlab.com/docker-scripts/ds /opt/docker-scripts/ds cd /opt/docker-scripts/ds/ make install 2. Install an NSD container: ds pull nsd ds init nsd @nsd cd /var/ds/nsd/ vim settings.sh ds make
  • 8. DNS Setup: Make sure that port 53 is free The NSD container needs access to the port 53 of the host: lsof -i :53 We should prevent systemd-resolved from using port 53: 1. Edit /etc/systemd/resolved.conf: [Resolve] DNS=8.8.8.8 DNSStubListener=no . . . . . 2. Create a symbolic link: ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf 3. Reboot the system 4. Check that port 53 is now free: lsof -i :53 5. Try again: ds make
  • 9. DNS Setup: Customize secondary nameservers On settings.sh, edit the constants SECONDARY_NS and AXFR_SERVERS. Then run again: ds make SECONDARY_NS=" ns0.1984.is puck.nether.net ns2.afraid.org " AXFR_SERVERS=" 93.95.224.6 204.42.254.5 69.65.50.192 108.61.224.67 116.203.6.3 . . . . . “
  • 10. Manage domains: Add a domain Let’s say that we have purchased the domain example.org 1. Set the nameservers of the domain (what is on SECONDARY_NS): ns0.1984.is puck.nether.net ns2.afraid.org 2. Add the domain to each secondary NS service https://www.buddyns.com/ https://1984.hosting/product/freedns/ https://puck.nether.net/dns https://freedns.afraid.org/secondary/ 3. Add a zone on the primary nameserver: cd /var/ds/nsd/ ds zone add example.org
  • 11. Manage domains: Modify DNS records 1. Edit zones/example.org.db and modify the records: cd /var/ds/nsd/ vim zones/example.org.db 2. Don’t forget to change the serial number too: 2022061901 ; serial 3. Notify the secondary nameservers that there are some updates: ds notify Alternatively, a ds restart will also reload the zones and send notifications to the secondary nameservers.
  • 12. Manage domains: Remove a domain 1. Remove it from each secondary nameserver service. 2. Remove its configuration on the primary server: cd /var/ds/nsd/ ds zone rm example.org 3. Alternatively, disable its configuration: ds zone dis example.org
  • 13. Troubleshooting 1. We can make some simple checks and tests like this: ds check --config ds check --zones 2. To check the AXFR response for a domain: ds zone test example.org It will actually list all the records that will be sent to a secondary nameserver. 3. For further troubleshooting, we can get a shell inside the container and try commands like these: systemctl restart nsd systemctl status nsd tail /var/log/syslog -n 30 dig @localhost AXFR example.org ufw status
  • 14. Maintenance: Migrate the primary nameserver To migrate the container of the primary nameserver to another host: 1. Transfer (with scp or rsync) the content of /var/ds/nsd/ from the old host to the new one. 2. On the new host, rebuild the container: ds pull nsd cd /var/ds/nsd/ ds make 3. The public IP of the master nameserver has been changed (to the IP of the new host), so we should update it on the configuration of each secondary nameserver, for each domain. 4. Replace the old IP with the new one on each zone file as well, then update the serial numbers and notify the secondary nameservers.
  • 15. Maintenance: Modify secondary nameservers If you need to modify the list of secondary nameservers, for example add ns1.1984.is on the list, or remove one from the list, you should also make sure to update these things: 1. For each domain that you manage, go to the website of the provider of the domain and update the list of the nameservers. 2. If you are adding a new secondary nameserver, go to the website of the nameserver and make sure that you add there all the domains that you manage, along with the public IP of the primary nameserver. 3. On the primary nameserver, update settings.sh accordingly and then run ds make to update the configuration files.
  • 16. Thank you for your attention! Any questions or comments? ➔ Dashamir Hoxha (dashohoxha@gmail.com) ➔ https://docker-scripts.gitlab.io/dns.html (Tutorial) ➔ https://events.fs.al/event/8/registrations/ (Workshop) Tutorial: Workshop: