Adding a DNS address (name-server) on Juniper Junos

In this lesson, I will show you how you can add one or more DNS IP addresses on the Juniper device (normally DNS is called name-server on Juniper).

What is the function of the DNS? It is to map the domain name to an IP address and vice versa.

In case you want that your router to reach domain names on the internet, you should provide it DNS servers IP addresses. By default, my Juniper router has 2 DNS IP addresses as the following:

root@Juniper# edit system

[edit system]

root@Juniper# show name-server

208.67.222.222;

208.67.220.220;

I would like to change them to 8.8.8.8 and 1.1.1.1 which are some public DNS IP addresses widely used.

I will delete the 1st DNS address and then add 8.8.8.8, because if you just add 8.8.8.8 then the current DNS IP addresses will not be replaced automatically:

 

[edit system]

root@Juniper# delete name-server ?

Possible completions:

<[Enter]>            Execute this command

<address>            DNS name server address

208.67.220.220       DNS name server address

208.67.222.222       DNS name server address

|                    Pipe through a command

[edit system]

root@Juniper# delete name-server 208.67.220.220

[edit system]

root@Juniper#

 

Let’s check if that specific DNS IP address has been deleted:

 

[edit system]

root@Juniper# show name-server

208.67.222.222;

[edit system]

root@Juniper#

Indeed, it has been deleted 😊

Let’s add now 8.8.8.8 DNS IP address:

[edit system]

root@Juniper# set name-server 8.8.8.8

[edit system]

root@Juniper# show name-server

208.67.222.222;

8.8.8.8;

Very good, the new DNS address has been added.

Now I want to replace the old DNS 208.67.222.222 with the new DNS 1.1.1.1 without I delete the old one as I have done in the previous step.

Let me show you how this can be done:

 

[edit system]

root@Juniper# edit name-server

[edit system name-server]

root@Juniper# rename 208.67.222.222 to 1.1.1.1

[edit system name-server]

root@Juniper#

Let’s see if this has been applied correctly:

 

[edit system name-server]

root@Juniper# show

1.1.1.1;

8.8.8.8;

[edit system name-server]

root@Juniper#

 

Indeed, the old DNS entry was replaced by the new IP address 1.1.1.1

This is all what I wanted to show you in this lesson, see you in the upcoming one 😊

Course Content

0 Comments

Submit a Comment

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


The reCAPTCHA verification period has expired. Please reload the page.

About