You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-machines/linux/azure-dns.md
+99-26Lines changed: 99 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ author: RicksterCDN
5
5
ms.service: virtual-machines
6
6
ms.subservice: networking
7
7
ms.topic: conceptual
8
-
ms.date: 10/19/2016
8
+
ms.date: 04/11/2023
9
9
ms.author: rclaus
10
10
ms.collection: linux
11
11
@@ -32,9 +32,11 @@ The following table illustrates scenarios and corresponding name resolution solu
32
32
| Reverse DNS for internal IPs |[Name resolution using your own DNS server](#name-resolution-using-your-own-dns-server)|n/a |
33
33
34
34
## Name resolution that Azure provides
35
+
35
36
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.
36
37
37
38
### Features and considerations
39
+
38
40
**Features:**
39
41
40
42
* 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
52
54
Names must use only 0-9, a-z, and '-', and they cannot start or end with a '-'. See RFC 3696 Section 2.
53
55
* 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).
54
56
55
-
### Getting the most from name resolution that Azure provides
57
+
### Getting the most from name resolution that Azure provides\
58
+
56
59
**Client-side caching:**
57
60
58
61
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
61
64
62
65
Several different DNS caching packages, such as dnsmasq, are available. Here are the steps to install dnsmasq on the most common distributions:
63
66
64
-
**Ubuntu (uses resolvconf)**
65
-
* Install the dnsmasq package (“sudo apt-get install dnsmasq”).
67
+
# [Ubuntu](#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](#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
+
```
66
113
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](#rhel)
73
115
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`.
5. Restart the network service to set the cache as the local DNS resolver
141
+
142
+
```bash
143
+
sudo systemctl restart NetworkManager
144
+
```
80
145
81
146
> [!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
+
---
85
150
86
151
**Client-side retries**
87
152
@@ -92,25 +157,33 @@ DNS is primarily a UDP protocol. Because the UDP protocol doesn't guarantee mess
92
157
93
158
To check the current settings on a Linux virtual machine, 'cat /etc/resolv.conf', and look at the 'options' line, for example:
94
159
160
+
```bash
161
+
sudo cat /etc/resolv.conf
162
+
```
163
+
95
164
```config-conf
96
165
options timeout:1 attempts:5
97
166
```
98
167
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:
100
169
101
170
**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.
104
174
105
175
**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.
108
179
109
180
**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.
112
184
113
185
## Name resolution using your own DNS server
186
+
114
187
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.
115
188
116
189
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