Day 5: DNS and Commands

Module: Web Basics, Service Side
Topics: *

Important Git Commands

  1. git init: To turn current directory into repository
  2. git branch [branch-name]: Creates a new branch
  3. git checkout [branch-name]: Switches to the specified branch and updates the
    working directory
  4. git add: Snapshots the file in preparation for versioning
  5. git commit: Records file snapshots permanently in version history
  6. git merge [branch]: Combines the specified branch
  7. git pull: git pull is a combination of git fetch and git merge
  8. git push: Uploads all local branch commits to GitHub
  9. git reset [commit]: Undoes all commits after [commit], preserving changes locally

more here for reference: Link

DNS and Reverse DNS

DNS or Domain Name Server is very important it it helps us find the corresponding IP address connected to the domain name, so a user can visit the website.

Steps involved to find the IP address are: Domain Name -> Browser cache -> OS Cache -> Resolver (usually ISP) -> Root Server (we have total 13 of them) -> TDLs (by ICANN, oldest is .com)-> Authoritative name server (domain providers) -> back to the user.

Note: We can also manipulate or override DNS from the OS by adding it into /etc/hosts file. It is called DNS Overriding.

Reverse DNS

It returns the domain name for a given IP address. They are commonly used by the email servers.


It is a security policy mechanism that helps websites against man-in-the-middle attacks such as protocol downgrade attacks (HTTP) and cookie hijacking.

It also allow to force the HTTPS connection on the http only site. In case it does not work, then user agent will simply terminate or close the connection

Browser and Rendering Engines

As a web developer we should be familiar with all the options available so we can be sure that the web app we are developing will work for most of them.

There are 3 most used Engines that is used by almost all the popular browsers.

  1. Blink — used by Google Chrome, Microsoft Edge, Opera, Electron-based desktop apps such as Slack, VS Code, etc. It was forked by WebKit
  2. Gecko (-moz-) – used by Mozilla Firefox
  3. WebKit (-webkit-) — used by Apple Safari

More information on this page: Comparison of browser engines

Steps of browser rendering:

  • Parsing HTML
  • Parsing CSS
  • Render Tree
  • Layout Flow
  • Painting

Request or User Flow

user ➞ browser ➞ internet ➞ web server ➞ application server (WordPress) ➞ php ➞ mysql


SMTP: It is used to send the email from client to the email server.

IMAP: It is used to receive the email to the server and the email client.

POP3: It is similar to the IMAP but once you download the email from the server to the email client then it will delete it from the server. That’s why we use IMAP over POP3.

Check available Memory/Disk/CPU on server

There are two command to check for the same:

  • df -h : disk space available for all file system
  • du -csh <directory path> : to see space occupied by a directory

Here are details.

  • df = disk free
  • -h = Human Readable
  • du = disk usage
  • -c = complete total for one directory
  • -s = does not display size of sub dir
  • -h = human readable size like 1G or 50K

rsync vs sync

These commands are used to download or upload data to the server or between a local and remote system.

rsync make sure only the changes are getting updates and not the whole content.

  • rsync -avzhP <source path> <destination path>

Source path and destination path can change according to the needs. Like if we want to send the data from local to remote or vice-versa

in -avzhP,

  • a stands for archive,
  • v  stands for “verbose”, it is necessary to get the appropriate output
  • z is compressed zip
  • h is human readable size like 1G for 1 Gigabytes
  • P is process or partials to track progress while downloading


SSH or secure shell is used to manage their servers, back up files, work remotely.

We can control the whole server using the SSH.

to connect and download or upload details we need to create ssh keygen first and then use the rsync to put the ssh key on to the server so it can verify it.

  • ssh-keygen -t rsa -b 4096 -C "user@myPC" -N “” -f ~/.ssh/id_rsa
  • rsync -avP ~/.ssh/ /root/.ssh/


  • -t is provider
  • -b is bits
  • -C is comment
  • -N is new_passphrase
  • -f is input_keyfile

“Good Work. Good People.”

Leave a Reply

Your email address will not be published. Required fields are marked *