<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Syed Fazil</title>
    <description>The latest articles on DEV Community by Syed Fazil (@syedfazil).</description>
    <link>https://dev.to/syedfazil</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3691571%2Fa95c1021-5d59-458a-8530-de44f4957b7f.png</url>
      <title>DEV Community: Syed Fazil</title>
      <link>https://dev.to/syedfazil</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/syedfazil"/>
    <language>en</language>
    <item>
      <title>Deploying on a VPS with GitHub Actions</title>
      <dc:creator>Syed Fazil</dc:creator>
      <pubDate>Sat, 20 Jun 2026 09:51:04 +0000</pubDate>
      <link>https://dev.to/syedfazil/deploying-on-a-vps-with-github-actions-3jh2</link>
      <guid>https://dev.to/syedfazil/deploying-on-a-vps-with-github-actions-3jh2</guid>
      <description>&lt;h2&gt;
  
  
  Why I am writing this post
&lt;/h2&gt;

&lt;p&gt;At the beginning of this year, I bought/rented (whatever you want to call it) a VPS to host my personal projects, and I learned a lot by setting it up and managing it.&lt;/p&gt;

&lt;p&gt;I have been making some small tools that I think are useful for me, and each of them goes through iterations.&lt;/p&gt;

&lt;p&gt;At each iteration,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;I check the code&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Commit my changes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Push them to GitHub&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SSH into my VPS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to the project directory&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pull the latest code&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run docker compose up -d --build to deploy the changes.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;But me being lazy as I am, I often end up not even making the changes I want to make because I don't like to go through this just following a set flow approach.&lt;/p&gt;

&lt;p&gt;There are a few reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;I learnt nothing new mostly&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There is a delay in response from the VPS when I type any character&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Most importantly, it is something I know can be easily automated&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Having worked with CI/CD pipelines with GitLab at work, I am aware that this repetitive work can be reduced to just a single command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, for my personal projects, like millions of developers around the world, I use GitHub&lt;/p&gt;

&lt;p&gt;And I know there is a CI/CD thingy called GitHub Actions, so this is my attempt at both learning and using GitHub Actions to make my life easier&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqgm0nknlgzvpux3eyyw8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqgm0nknlgzvpux3eyyw8.png" alt=" " width="662" height="497"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's begin
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Enable Actions in the project
&lt;/h3&gt;

&lt;p&gt;To use actions, we go to the repository in GitHub and select the "Settings" tab.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjdcidm7hm98hol6z4egk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjdcidm7hm98hol6z4egk.png" alt=" " width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the “Actions” dropdown and the “General” option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fseorzcnkeyk5nnjhb09p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fseorzcnkeyk5nnjhb09p.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select “Allow fazil-syed and select non-fazil-syed actions and reusable workflows”&lt;/p&gt;

&lt;p&gt;and check&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Allow actions created by GitHub&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Allow actions by Marketplace&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I am choosing this option for security reasons so no malicious action gets accidentally run.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flg2f908e9k5b1xauhcie.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flg2f908e9k5b1xauhcie.png" alt=" " width="800" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and save.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting up GitHub variables
&lt;/h3&gt;

&lt;p&gt;So how will GitHub (runner) do anything on my VPS? Obviously, at this point only I have the secret stuff needed to access it.&lt;/p&gt;

&lt;p&gt;Hence, we need to create a new set of secret stuff or use existing ones and store them in GitHub as secrets.&lt;/p&gt;

&lt;p&gt;The secret stuff in this case are&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;SSH Host (IP of the VPS)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SSH Keys&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SSH Port&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SSH Username&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Generating New SSH Keys
&lt;/h3&gt;

&lt;p&gt;So let's now create a new SSH key&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Generate a deployment key locally
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519 &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"github-actions-deploy"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enter the file path&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/Users/syedfazil/.ssh/github_actions_deploy

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The command creates two files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;github_actions_deploy
github_actions_deploy.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;github_actions_deploy&lt;/code&gt; is the private key. Store its contents in the &lt;code&gt;SSH_PRIVATE_KEY&lt;/code&gt; GitHub Secret.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;github_actions_deploy.pub&lt;/code&gt; is the public key. Add it to the VPS's &lt;code&gt;authorized_keys&lt;/code&gt; file.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt; Copy the public key
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /Users/syedfazil/.ssh/github_actions_deploy.pub | pbcopy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt; Add the public key to the VPS authorised SSH keys
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vi ~/.ssh/authorized_keys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the copied SSH key at the end of the file&lt;/p&gt;

&lt;h3&gt;
  
  
  Storing the secrets in GitHub
&lt;/h3&gt;

&lt;p&gt;We go to settings again&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F551o9amqhc4sapzh77zp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F551o9amqhc4sapzh77zp.png" alt=" " width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scroll down, click on the “Secrets and variables”&amp;nbsp;drop-down, and then on the “Actions”&amp;nbsp;button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk07wmddqsepm9rx4fzao.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk07wmddqsepm9rx4fzao.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on “New repository secret”&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgd3au90m8qzmczum0dvy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgd3au90m8qzmczum0dvy.png" alt=" " width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, set the variable. And click on “Add secret”.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;We need to repeat this process for all four of these variables.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy3d4buspuuvstsrqr8mz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy3d4buspuuvstsrqr8mz.png" alt=" " width="799" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  GitHub Action Workflow
&lt;/h3&gt;

&lt;p&gt;Now we are at the conclusion of our work so far&lt;/p&gt;

&lt;p&gt;We will set up a GitHub action with this directory structure&lt;/p&gt;

&lt;p&gt;&lt;em&gt;.github/workflows/publish.yaml&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Inside this file, let's throw the following code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;SSH into VPS and deploy&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;deploy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy over SSH&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy project over SSH&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;appleboy/ssh-action@v1&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.SSH_HOST }}&lt;/span&gt;
          &lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.SSH_USERNAME }}&lt;/span&gt;
          &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.SSH_PRIVATE_KEY }}&lt;/span&gt;
          &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.SSH_PORT }}&lt;/span&gt;
          &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
            &lt;span class="s"&gt;mkdir -p opensource-usefull&lt;/span&gt;

            &lt;span class="s"&gt;if [ ! -d opensource-usefull/rssskull/.git ]; then&lt;/span&gt;
              &lt;span class="s"&gt;git clone https://github.com/fazil-syed/rssskull.git opensource-usefull/rssskull&lt;/span&gt;
            &lt;span class="s"&gt;fi&lt;/span&gt;

            &lt;span class="s"&gt;cd opensource-usefull/rssskull&lt;/span&gt;
            &lt;span class="s"&gt;git pull --rebase -Xours&lt;/span&gt;

            &lt;span class="s"&gt;docker compose up -d --build&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, on our next commit, this job will fire and deploy our latest changes&lt;/p&gt;

&lt;p&gt;Let's go line by line&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;SSH into VPS and deploy&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This defines the name of the action. Pretty self-explanatory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This determines the branch that will trigger the action. In this case,&amp;nbsp;&lt;code&gt;main&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;deploy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy over SSH&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This does several things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Determines the one job that we are using.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It runs on Ubuntu.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;And the name of the job.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's understand the complicated part&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy project over SSH&lt;/span&gt;
    &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;appleboy/ssh-action@v1&lt;/span&gt;
    &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.SSH_HOST }}&lt;/span&gt;
      &lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.SSH_USERNAME }}&lt;/span&gt;
      &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.SSH_PRIVATE_KEY }}&lt;/span&gt;
      &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.SSH_PORT }}&lt;/span&gt;
      &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
        &lt;span class="s"&gt;mkdir -p opensource-usefull&lt;/span&gt;

        &lt;span class="s"&gt;if [ ! -d opensource-usefull/rssskull/.git ]; then&lt;/span&gt;
          &lt;span class="s"&gt;git clone https://github.com/fazil-syed/rssskull.git opensource-usefull/rssskull&lt;/span&gt;
        &lt;span class="s"&gt;fi&lt;/span&gt;

        &lt;span class="s"&gt;cd opensource-usefull/rssskull&lt;/span&gt;
        &lt;span class="s"&gt;git pull --rebase -Xours&lt;/span&gt;

        &lt;span class="s"&gt;docker compose up -d --build&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This step defines a script that deploys our project to our VPS via SSH.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  name: Deploy project over SSH&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This sets the name of the step.&lt;/p&gt;

&lt;p&gt;uses: appleboy/ssh-action@v1&lt;/p&gt;

&lt;p&gt;This allows us to use SSH very easily using third-party actions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.SSH_HOST }}&lt;/span&gt;
&lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.SSH_USERNAME }}&lt;/span&gt;
&lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.SSH_PRIVATE_KEY }}&lt;/span&gt;
&lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.SSH_PORT }}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives&amp;nbsp;&lt;code&gt;ssh-action&lt;/code&gt;&amp;nbsp;access to the environment variables we set on GitHub. With these variables, we will be able to deploy to the VPS.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Script
&lt;/h3&gt;

&lt;p&gt;This is a simple script made in bash.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
  &lt;span class="s"&gt;mkdir -p opensource-usefull&lt;/span&gt;

  &lt;span class="s"&gt;if [ ! -d opensource-usefull/rssskull/.git ]; then&lt;/span&gt;
    &lt;span class="s"&gt;git clone https://github.com/fazil-syed/rssskull.git opensource-usefull/rssskull&lt;/span&gt;
  &lt;span class="s"&gt;fi&lt;/span&gt;

  &lt;span class="s"&gt;cd opensource-usefull/rssskull&lt;/span&gt;
  &lt;span class="s"&gt;git pull --rebase -Xours&lt;/span&gt;

  &lt;span class="s"&gt;docker compose up -d --build&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The&amp;nbsp;&lt;code&gt;script:&lt;/code&gt;&amp;nbsp;section lets us execute a script.&lt;/p&gt;

&lt;p&gt;Let's go over the logic of the script&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; opensource-usefull
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates the parent directory if it doesn't exist&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; opensource-usefull/rssskull/.git &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check if my project's directory exists on the VPS&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/fazil-syed/rssskull.git opensource-usefull/rssskull
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If not, then clone the project into the VPS&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;opensource-usefull/rssskull
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We enter the directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git pull &lt;span class="nt"&gt;--rebase&lt;/span&gt; &lt;span class="nt"&gt;-Xours&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I do a rebase, discarding all local changes (changes in the VPS) in favour of the remote changes (changes in GitHub).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker compose up &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;--build&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, we are using docker compose to build and run the project&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's see it in action
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F11ffua90dm4abqivd03d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F11ffua90dm4abqivd03d.png" alt=" " width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh44k5bz9rcrv417uwaxu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh44k5bz9rcrv417uwaxu.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;How to set up a very simple continuous deployment pipeline with GitHub Actions, a VPS and SSH&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Taking screenshots in the browser, adding little highlight boxes and pasting them into markdown is very annoying.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>devops</category>
      <category>cicd</category>
      <category>github</category>
    </item>
    <item>
      <title>Let’s break down DNS: how your browser finds a website</title>
      <dc:creator>Syed Fazil</dc:creator>
      <pubDate>Fri, 09 Jan 2026 17:11:42 +0000</pubDate>
      <link>https://dev.to/syedfazil/lets-break-down-dns-how-your-browser-finds-a-website-15lf</link>
      <guid>https://dev.to/syedfazil/lets-break-down-dns-how-your-browser-finds-a-website-15lf</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;To anyone reading this and finds it stupid or annoying, this is my first attempt.&lt;/p&gt;

&lt;p&gt;This post is meant for beginners who enjoy a poor guy’s attempt at demystifying the web.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  What is DNS?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;DNS (Domain Name System)&lt;/strong&gt; - In simple terms, it's basically a group of computers pointing fingers, and it's also a phonebook for the internet&lt;/p&gt;

&lt;h3&gt;
  
  
  Why should I care?
&lt;/h3&gt;

&lt;p&gt;Well, if it goes down or if you are unable to access it, you can't doomscroll on Instagram, and also not reach this awesome place to read about DNS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why is it needed?
&lt;/h3&gt;

&lt;p&gt;Without &lt;strong&gt;DNS&lt;/strong&gt;, you would have to write &lt;code&gt;172.217.70.138&lt;/code&gt; every time you wanted to Google Cat images.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;172.217.70.138&lt;/code&gt; is the IP address of google.com&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Terminology (In My Own Words)
&lt;/h3&gt;

&lt;p&gt;For anyone who, like me, gets the jargon all mixed up, here's a quick intro/refresher&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DNS&lt;/strong&gt;: Domain Name System (The phonebook)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DNS Resolver&lt;/strong&gt;: A little thingy on your device that asks,&lt;br&gt;&lt;br&gt;
"Hey, what’s the IP address for this domain?"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DNS Server&lt;/strong&gt;: A server within the DNS that stores the DNS records (A page that includes the mapping of your name (domain) to your address (IP))&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DNS Zone&lt;/strong&gt;: A special place in the DNS world that you manage (your domain and its subdomains)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Domain&lt;/strong&gt;: The name in the phonebook (your favorite website)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Registrant&lt;/strong&gt;: This is you when you want to buy a domain&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Registrar&lt;/strong&gt;: This is the business selling you the domain&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Register&lt;/strong&gt;: The organization that maintains the official record that proves you own the domain&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  The Curiosity
&lt;/h3&gt;

&lt;h4&gt;
  
  
  So why am I writing this post?
&lt;/h4&gt;

&lt;p&gt;Actually, this is because I went down a rabbit hole a few days back, and it all began when I thought of buying a domain for myself, and having never done it before, I was curious&lt;/p&gt;

&lt;p&gt;I didn't look for who would sell me the domain; instead, I went to a trusted source (ChatGPT) and asked what do I do to buy a domain?&lt;/p&gt;

&lt;p&gt;The answer was quite simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Go to a registrar&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Buy a domain&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Point it to a server where your content lives&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But that almost seems like magic, so let's break the spell&lt;/p&gt;




&lt;h2&gt;
  
  
  Breaking DNS into Zones
&lt;/h2&gt;

&lt;p&gt;DNS works in layers (or zones), starting from the top and working its way down to you.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Root Zone (&lt;code&gt;.&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;It all begins here.&lt;/p&gt;

&lt;p&gt;This &lt;code&gt;.&lt;/code&gt; (dot) is the root zone where everyone must cross to reach their destination&lt;/p&gt;

&lt;h4&gt;
  
  
  But what does it do?
&lt;/h4&gt;

&lt;p&gt;The root zone doesn’t know where every website lives.&lt;/p&gt;

&lt;p&gt;Instead, it knows where &lt;strong&gt;Top-Level Domains&lt;/strong&gt; live. Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;.com&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;.org&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;.dev&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Top-Level Domains (TLDs)
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;.com&lt;/code&gt; or &lt;code&gt;.dev&lt;/code&gt; and such domains are called the &lt;strong&gt;Top-Level Domains&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;They are managed (not in an evil way, hopefully) by billion-dollar companies like &lt;strong&gt;Verisign&lt;/strong&gt; and &lt;strong&gt;Google&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Their job is simple&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Point to the authoritative servers for the domains under them.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  So where does this end?
&lt;/h3&gt;

&lt;p&gt;It ends with &lt;strong&gt;you&lt;/strong&gt;, I mean your DNS zone.&lt;/p&gt;

&lt;p&gt;Here's a quick example with my very own domain: &lt;a href="https://syedfazil.dev" rel="noopener noreferrer"&gt;&lt;code&gt;syedfazil.dev&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fef3mhzr6xf90mawzimjp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fef3mhzr6xf90mawzimjp.png" alt="DNS resolution with syedfazil.dev example" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's roughly how things go:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;I go to &lt;a href="https://syedfazil.dev" rel="noopener noreferrer"&gt;&lt;code&gt;syedfazil.dev&lt;/code&gt;&lt;/a&gt; on my device&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;My device asks its DNS resolver&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;"What's the IP address of &lt;a href="http://syedfazil.dev" rel="noopener noreferrer"&gt;&lt;code&gt;syedfazil.dev&lt;/code&gt;&lt;/a&gt;?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The resolver asks a &lt;strong&gt;root server&lt;/strong&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Where can I find &lt;code&gt;.dev&lt;/code&gt;?"&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Considering that &lt;code&gt;.dev&lt;/code&gt; is managed by Google, the root server responds:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;code&gt;.dev&lt;/code&gt; is handled by Google’s TLD servers."&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now we know where .dev is, so let's ask Google:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Where is &lt;a href="http://syedfazil.dev" rel="noopener noreferrer"&gt;&lt;code&gt;syedfazil.dev&lt;/code&gt;&lt;/a&gt;?"&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Google responds with the &lt;strong&gt;nameservers&lt;/strong&gt; of the registrar that sold the domain to me (in my case, from Porkbun).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finally, the resolver asks those nameservers for the actual records.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, as of writing this blog post, I don't have any IP directly mapped to &lt;a href="http://syedfazil.dev" rel="noopener noreferrer"&gt;syedfazil.dev&lt;/a&gt;, but porkbun, for the time being, has set its own default page.&lt;/p&gt;

&lt;p&gt;But I do have another subdomain mapped to hashnode that is &lt;a href="http://blog.syedfazil.dev" rel="noopener noreferrer"&gt;&lt;code&gt;blog.syedfazil.dev&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  So you might ask, where does it know the address of &lt;a href="http://blog.syedfazil.dev" rel="noopener noreferrer"&gt;&lt;code&gt;blog.syedfazil.dev&lt;/code&gt;&lt;/a&gt; from?
&lt;/h4&gt;

&lt;p&gt;The answer is that we have already reached the end.&lt;/p&gt;

&lt;p&gt;My DNS zone ends at &lt;a href="http://syedfazil.dev" rel="noopener noreferrer"&gt;&lt;code&gt;syedfazil.dev&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So any subdomains (&lt;code&gt;blog&lt;/code&gt;, &lt;code&gt;api&lt;/code&gt;, &lt;code&gt;www&lt;/code&gt;, etc.) that I have will be present here, and voila, you have successfully learnt how domain name resolution works.&lt;/p&gt;




&lt;h2&gt;
  
  
  A bit of technical stuff for the nerdy folks
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;There are &lt;strong&gt;13 logical root servers&lt;/strong&gt; (named A to M) that use &lt;strong&gt;anycasting&lt;/strong&gt; to distribute the load over thousands of servers all over the world&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;anycast&lt;/strong&gt;, meaning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each “server” is actually many servers&lt;/li&gt;
&lt;li&gt;Spread all over the world&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;This robust network has survived multiple DDoS attempts&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;




&lt;p&gt;So if you have made it this far, then there's more for you&lt;/p&gt;

&lt;h2&gt;
  
  
  Can someone else take over my domain?
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;In theory:&lt;/strong&gt; Yes&lt;br&gt;
&lt;strong&gt;In practice:&lt;/strong&gt; Most likely not&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Here's why
&lt;/h3&gt;

&lt;p&gt;The Internet is a mix of both centralized and decentralized systems&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;While the &lt;strong&gt;TLDs&lt;/strong&gt; and &lt;strong&gt;root&lt;/strong&gt; servers are managed by a few companies and universities&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Your zone can be managed by anyone, including yourself!&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But let's say you aren't going to host your server for DNS and give that job to someone who already does it, for example, let's take &lt;strong&gt;Google DNS&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Here's what you would do
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You would go over to your &lt;strong&gt;Google Cloud Console&lt;/strong&gt; account&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a &lt;strong&gt;DNS zone&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Get the &lt;strong&gt;nameservers&lt;/strong&gt; from Google, then&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go over to your &lt;strong&gt;registrar&lt;/strong&gt; and tell them that you want to use the Google nameservers for your zone.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Where's the risk?
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Anyone&lt;/strong&gt; can create a DNS zone in Google DNS&lt;/p&gt;

&lt;p&gt;If you were to&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Go to &lt;strong&gt;Google&lt;/strong&gt; and create a &lt;em&gt;DNS zone&lt;/em&gt; for &lt;a href="http://syedfazil.dev" rel="noopener noreferrer"&gt;&lt;code&gt;syedfazil.dev&lt;/code&gt;&lt;/a&gt; before me and point it to your IP, and&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I was dumb enough to delegate it to my zone to Google before I created the zone&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then you would have taken over my domain &lt;em&gt;(temporarily)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;But what if you create the DNS zone later?&lt;/p&gt;

&lt;p&gt;Well, you can't because there can only be &lt;strong&gt;one zone&lt;/strong&gt; per domain in a nameserver.&lt;/p&gt;

&lt;p&gt;So if you really wanted to use &lt;strong&gt;Google DNS&lt;/strong&gt;, then you can ask the good folks at Google to remove the impostor zone by proving ownership of your domain&lt;/p&gt;

&lt;h4&gt;
  
  
  Why doesn't this happen frequently?
&lt;/h4&gt;

&lt;p&gt;Because what are the chances that someone will create a DNS zone for your domain before you? And even if they did, you can switch the nameserver to someone else, like from Google to Cloudflare&lt;/p&gt;

&lt;h3&gt;
  
  
  The End
&lt;/h3&gt;

&lt;p&gt;If you have read till the end, then thank you, and I really appreciate your time, and if there's anything that I have gotten wrong, then please feel free to correct me, and if you have any thoughts or questions, please comment&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>networking</category>
      <category>dns</category>
    </item>
  </channel>
</rss>
