Skip to content

Commit 5eef1d9

Browse files
Merge pull request #234115 from divargas-msft/patch-3
[Doc-a-thon] Updating azure-dns.md
2 parents 0e2b567 + 9a6841a commit 5eef1d9

File tree

1 file changed

+99
-26
lines changed

1 file changed

+99
-26
lines changed

articles/virtual-machines/linux/azure-dns.md

Lines changed: 99 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: RicksterCDN
55
ms.service: virtual-machines
66
ms.subservice: networking
77
ms.topic: conceptual
8-
ms.date: 10/19/2016
8+
ms.date: 04/11/2023
99
ms.author: rclaus
1010
ms.collection: linux
1111

@@ -32,9 +32,11 @@ The following table illustrates scenarios and corresponding name resolution solu
3232
| Reverse DNS for internal IPs |[Name resolution using your own DNS server](#name-resolution-using-your-own-dns-server) |n/a |
3333

3434
## Name resolution that Azure provides
35+
3536
Along with resolution of public DNS names, Azure provides internal name resolution for virtual machines and role instances that are in the same virtual network. In virtual networks that are based on Azure Resource Manager, the DNS suffix is consistent across the virtual network; the FQDN is not needed. DNS names can be assigned to both network interface cards (NICs) and virtual machines. Although the name resolution that Azure provides does not require any configuration, it is not the appropriate choice for all deployment scenarios, as seen on the preceding table.
3637

3738
### Features and considerations
39+
3840
**Features:**
3941

4042
* No configuration is required to use name resolution that Azure provides.
@@ -52,7 +54,8 @@ Along with resolution of public DNS names, Azure provides internal name resoluti
5254
Names must use only 0-9, a-z, and '-', and they cannot start or end with a '-'. See RFC 3696 Section 2.
5355
* DNS query traffic is throttled for each virtual machine. Throttling shouldn't impact most applications. If request throttling is observed, ensure that client-side caching is enabled. For more information, see [Getting the most from name resolution that Azure provides](#getting-the-most-from-name-resolution-that-azure-provides).
5456

55-
### Getting the most from name resolution that Azure provides
57+
### Getting the most from name resolution that Azure provides\
58+
5659
**Client-side caching:**
5760

5861
Some DNS queries are not sent across the network. Client-side caching helps reduce latency and improve resilience to network inconsistencies by resolving recurring DNS queries from a local cache. DNS records contain a Time-To-Live (TTL), which enables the cache to store the record for as long as possible without impacting record freshness. As a result, client-side caching is suitable for most situations.
@@ -61,27 +64,89 @@ Some Linux distributions do not include caching by default. We recommend that yo
6164

6265
Several different DNS caching packages, such as dnsmasq, are available. Here are the steps to install dnsmasq on the most common distributions:
6366

64-
**Ubuntu (uses resolvconf)**
65-
* Install the dnsmasq package (“sudo apt-get install dnsmasq”).
67+
# [Ubuntu](#tab/ubuntu)
68+
69+
1. Install the dnsmasq package:
70+
71+
```bash
72+
sudo apt-get install dnsmasq
73+
```
74+
75+
2. Enable the dnsmasq service:
76+
77+
```bash
78+
sudo systemctl enable dnsmasq.service
79+
```
80+
81+
3. Start the dnsmasq service:
82+
83+
```bash
84+
sudo systemctl start dnsmasq.service
85+
```
86+
87+
# [SUSE](#tab/sles)
88+
89+
1. Install the dnsmasq package:
90+
91+
```bash
92+
sudo zypper install dnsmasq
93+
```
94+
95+
2. Enable the dnsmasq service:
96+
97+
```bash
98+
sudo systemctl enable dnsmasq.service
99+
```
100+
101+
3. Start the dnsmasq service:
102+
103+
```bash
104+
sudo systemctl start dnsmasq.service
105+
```
106+
107+
4. Edit `/etc/sysconfig/network/config` file using a text editor, and change `NETCONFIG_DNS_FORWARDER=""` to `dnsmasq`.
108+
5. Update `/etc/resolv.conf` to set the cache as the local DNS resolver.
109+
110+
```bash
111+
sudo netconfig update
112+
```
66113

67-
**SUSE (uses netconf)**:
68-
1. Install the dnsmasq package (“sudo zypper install dnsmasq”).
69-
2. Enable the dnsmasq service (“systemctl enable dnsmasq.service”).
70-
3. Start the dnsmasq service (“systemctl start dnsmasq.service”).
71-
4. Edit “/etc/sysconfig/network/config”, and change NETCONFIG_DNS_FORWARDER="" to ”dnsmasq”.
72-
5. Update resolv.conf ("netconfig update") to set the cache as the local DNS resolver.
114+
# [CentOS/RHEL](#tab/rhel)
73115

74-
**CentOS by Rogue Wave Software (formerly OpenLogic; uses NetworkManager)**
75-
1. Install the dnsmasq package (“sudo yum install dnsmasq”).
76-
2. Enable the dnsmasq service (“systemctl enable dnsmasq.service”).
77-
3. Start the dnsmasq service (“systemctl start dnsmasq.service”).
78-
4. Add “prepend domain-name-servers 127.0.0.1;” to “/etc/dhclient-eth0.conf”.
79-
5. Restart the network service (“service network restart”) to set the cache as the local DNS resolver
116+
1. Install the dnsmasq package:
117+
118+
```bash
119+
sudo yum install dnsmasq -y
120+
```
121+
122+
2. Enable the dnsmasq service:
123+
124+
```bash
125+
sudo systemctl enable dnsmasq.service
126+
```
127+
128+
3. Start the dnsmasq service:
129+
130+
```bash
131+
sudo systemctl start dnsmasq.service
132+
```
133+
134+
4. Add `prepend domain-name-servers 127.0.0.1;` to `/etc/dhcp/dhclient.conf`.
135+
136+
```bash
137+
sudo echo "prepend domain-name-servers 127.0.0.1;" >> /etc/dhcp/dhclient.conf
138+
```
139+
140+
5. Restart the network service to set the cache as the local DNS resolver
141+
142+
```bash
143+
sudo systemctl restart NetworkManager
144+
```
80145

81146
> [!NOTE]
82-
> : The 'dnsmasq' package is only one of the many DNS caches that are available for Linux. Before you use it, check its suitability for your needs and that no other cache is installed.
83-
>
84-
>
147+
> The `dnsmasq` package is only one of the many DNS caches that are available for Linux. Before you use it, check its suitability for your needs and that no other cache is installed.
148+
149+
---
85150

86151
**Client-side retries**
87152

@@ -92,25 +157,33 @@ DNS is primarily a UDP protocol. Because the UDP protocol doesn't guarantee mess
92157

93158
To check the current settings on a Linux virtual machine, 'cat /etc/resolv.conf', and look at the 'options' line, for example:
94159

160+
```bash
161+
sudo cat /etc/resolv.conf
162+
```
163+
95164
```config-conf
96165
options timeout:1 attempts:5
97166
```
98167

99-
The resolv.conf file is auto-generated and should not be edited. The specific steps that add the 'options' line vary by distribution:
168+
The `/etc/resolv.conf` file is auto-generated and should not be edited. The specific steps that add the 'options' line vary by distribution:
100169

101170
**Ubuntu** (uses resolvconf)
102-
1. Add the options line to '/etc/resolvconf/resolv.conf.d/head'.
103-
2. Run 'resolvconf -u' to update.
171+
172+
1. Add the options line to `/etc/resolvconf/resolv.conf.d/head` file.
173+
2. Run `sudo resolvconf -u` to update.
104174

105175
**SUSE** (uses netconf)
106-
1. Add 'timeout:1 attempts:5' to the NETCONFIG_DNS_RESOLVER_OPTIONS="" parameter in '/etc/sysconfig/network/config'.
107-
2. Run 'netconfig update' to update.
176+
177+
1. Add `timeout:1 attempts:5` to the `NETCONFIG_DNS_RESOLVER_OPTIONS=""` parameter in `/etc/sysconfig/network/config`.
178+
2. Run `sudo netconfig update` to update.
108179

109180
**CentOS by Rogue Wave Software (formerly OpenLogic)** (uses NetworkManager)
110-
1. Add 'RES_OPTIONS="timeout:1 attempts:5"' to '/etc/sysconfig/network'.
111-
2. Run 'service network restart' to update.
181+
182+
1. Add `RES_OPTIONS="timeout:1 attempts:5"` to `/etc/sysconfig/network`.
183+
2. Run `systemctl restart NetworkManager` to update.
112184

113185
## Name resolution using your own DNS server
186+
114187
Your name resolution needs may go beyond the features that Azure provides. For example, you might require DNS resolution between virtual networks. To cover this scenario, you can use your own DNS servers.
115188

116189
DNS servers within a virtual network can forward DNS queries to recursive resolvers of Azure to resolve hostnames that are in the same virtual network. For example, a DNS server that runs in Azure can respond to DNS queries for its own DNS zone files and forward all other queries to Azure. This functionality enables virtual machines to see both your entries in your zone files and hostnames that Azure provides (via the forwarder). Access to the recursive resolvers of Azure is provided via the virtual IP 168.63.129.16.

0 commit comments

Comments
 (0)