Adding & Removing DNS server and NTP server on VMware NSX Manager or NSX Edge

Table of Contents

Introduction

In this blog we will show how to update the NTP and DNS servers on your NSX Manager or NSX Edge.

DNS server

In this section we will first list our current DNS servers after that we will add our new DNS servers and remove our old DNS servers.

List DNS servers

Before we can add or remove DNS servers we will first need to list the current DNS servers. We can perform this by following these steps:

1. SSH in to your NSX Manager or NSX Edge with the Admin account.

2. Run the following command:

					get name-servers
				

3. You will get a result like this:

					Sun Jan 14 2024 CEST 21:12:59.787
172.16.2.1
172.16.2.2
				

Add DNS servers

Now we now the current DNS Servers we can start adding our new DNS servers. We can perform this by following these steps:

1. SSH in to your NSX Manager or NSX Edge with the Admin account.

2. Run the following command:

					set name-servers 172.16.100.1
set name-servers 172.16.100.2
				

3. Now validate the DNS Servers:

					get name-servers
				

You will get a result like this:

					Sun Jan 14 2024 CEST 21:17:12.249
172.16.2.1
172.16.2.2
172.16.100.1
172.16.100.2
				

Remove DNS servers

After we have added our new DNS servers we can remove the old DNS servers. We can perform this by following these steps:

1. SSH in to your NSX Manager or NSX Edge with the Admin account.

2. Run the following command:

					del name-servers 172.16.2.1
del name-servers 172.16.2.2
				

3. Now validate the DNS Servers:

					get name-servers
				

You will get a result like this:

					Sun Jan 14 2024 CEST 21:19:36.015
172.16.100.1
172.16.100.2
				

NTP server

In this section we will first list our current NTP servers after that we will add our new NTP servers and remove our old NTP servers.

List NTP servers

Before we can add or remove NTP servers we will first need to list the current NTP servers. We can perform this by following these steps:

1. SSH in to your NSX Manager or NSX Edge with the Admin account.

2. Run the following command:

					get ntp-servers
				

3. You will get a result like this:

					Sun Jan 14 2024 CEST 21:22:29.872
172.16.2.1
172.16.2.2
				

Add NTP servers

Now we now the current NTP Servers we can start adding our new NTP servers. We can perform this by following these steps:

1. SSH in to your NSX Manager or NSX Edge with the Admin account.

2. Run the following command:

					set ntp-servers 172.16.100.1
set ntp-servers 172.16.100.2
				

3. Now validate the NTP Servers:

					get ntp-servers
				

You will get a result like this:

					Sun Jan 14 2024 CEST 21:23:05.592
172.16.2.1
172.16.2.2
172.16.100.1
172.16.100.2
				

Remove NTP servers

After we have added our new NTP servers we can remove the old NTP servers. We can perform this by following these steps:

1. SSH in to your NSX Manager or NSX Edge with the Admin account.

2. Run the following command:

					del ntp-servers 172.16.2.1
del ntp-servers 172.16.2.2
				

3. Now validate the NTP Servers:

					get ntp-servers
				

You will get a result like this:

					Sun Jan 14 2024 CEST 21:24:48.847
172.16.100.1
172.16.100.2
				
Awid Dashtgoli
Awid Dashtgoli