Skip to main content

Command Palette

Search for a command to run...

Network Configuration in Ubuntu

Published
2 min read
Network Configuration in Ubuntu
M

Hi, How are you !! Hope you doing good....

I got introduced to Cloud initially. As I went ahead learning what is cloud and how it works, then got to know a field which is DevOps that makes Cloud model more effective.

So, as I started working & got good experience on AWS. I have been learning the DevOps tool and technologies on how to use it with the Cloud, which will give me good understanding on how Cloud and DevOps go hand in hand to deploy my applications.

Last Blog Review

In the last blog we understood, what is GNuPG key, how to make the public key accessible and how to create and use a GNuPG key.

Local DNS Resolution

The local dns resolution of Linux OS, is stored in “/etc/hosts”. Because it contains list of hosts that are to be resolved locally.

Example of such file

1.2.3.4  your-node-name.your-domain-name localhost.localdomain localhost
X.X.X.X  node-name

Directory for DNS Servers for domain name resolution

The file in which the directory for DNS Servers for domain name resolution is “/etc/resolv.conf”

Example

nameserver 1.1.1.1 # IP address of the primary name server
nameserver 1.2.1.3 # IP address of the secondary name server

Inorder to query a domain “A” record

dig your-domain-name +short

Manipulating Routes

Displaying Route

route # Displays or lists routes and resolve hosts names
route -n # Displays or lists routes without resolving hosts name for faster result

Add or Delete route

  1. add or delete = It will add or delete a route

    Ex. add route

     route add -host 1.1.1.1 eth1
    

    Ex. Delete route

     route del -net 1.1.1.1/1
    
  2. -host x.x.x.x = Add route to a single host identified by IP address

  3. -net x.x.x.x = Add route to a network identified by network address

    Ex.

     route add -net 2.2.2.0 netmask 255.255.255.0 eth0
    
  4. gw x.x.x.x = specify the network address

    Ex.

     route add default gw 1.1.1.1 eth1
    
  5. netmask x.x.x.x = specify the network netmask

  6. default = add’s a default route

Conclusion →

In the this blog we understood, where we can have fun with local dns resolution, and Directory for DNS Server for name resolution, also we checked how to display route on the NIC cards of the Linux machine.

💡
That’s a wrap for today’s post! I hope this has given you some valuable insights. Be sure to explore more articles on our blog for further tips and advice. See you in the next post!

Image credit →

https://share.google/images/KZpZlg1yRxHxa6pzu

More from this blog

Mihir's Tech blog

69 posts