| 
									
										
										
										
											2019-08-30 15:58:25 +01:00
										 |  |  | .\" Generated by Mmark Markdown Processer - mmark.miek.nl | 
					
						
							| 
									
										
										
										
											2021-03-08 11:15:45 +00:00
										 |  |  | .TH "COREDNS-IMPORT" 7 "March 2021" "CoreDNS" "CoreDNS Plugins" | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-24 12:37:27 +01:00
										 |  |  | .SH "NAME" | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .PP | 
					
						
							| 
									
										
										
										
											2019-09-27 13:30:22 +01:00
										 |  |  | \fIimport\fP - includes files or references snippets from a Corefile. | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-24 12:37:27 +01:00
										 |  |  | .SH "DESCRIPTION" | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .PP | 
					
						
							| 
									
										
										
										
											2019-09-27 13:30:22 +01:00
										 |  |  | The \fIimport\fP plugin can be used to include files into the main configuration. Another use is to | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | reference predefined snippets. Both can help to avoid some duplication. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PP | 
					
						
							| 
									
										
										
										
											2019-10-10 07:45:28 +01:00
										 |  |  | This is a unique plugin in that \fIimport\fP can appear outside of a server block. In other words, it | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | can appear at the top of a Corefile where an address would normally be. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-24 12:37:27 +01:00
										 |  |  | .SH "SYNTAX" | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .PP | 
					
						
							|  |  |  | .RS | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .nf | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | import PATTERN | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | .fi | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .RE | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .IP \(bu 4 | 
					
						
							|  |  |  | \fBPATTERN\fP is the file, glob pattern (\fB\fC*\fR) or snippet to include. Its contents will replace | 
					
						
							|  |  |  | this line, as if that file's contents appeared here to begin with. | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-24 12:37:27 +01:00
										 |  |  | .SH "FILES" | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .PP | 
					
						
							|  |  |  | You can use \fIimport\fP to include a file or files. This file's location is relative to the | 
					
						
							|  |  |  | Corefile's location. It is an error if a specific file cannot be found, but an empty glob pattern is | 
					
						
							|  |  |  | not an error. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-24 12:37:27 +01:00
										 |  |  | .SH "SNIPPETS" | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .PP | 
					
						
							|  |  |  | You can define snippets to be reused later in your Corefile by defining a block with a single-token | 
					
						
							|  |  |  | label surrounded by parentheses: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PP | 
					
						
							|  |  |  | .RS | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .nf | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | (mysnippet) { | 
					
						
							| 
									
										
										
										
											2019-09-27 13:30:22 +01:00
										 |  |  |     ... | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | .fi | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .RE | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PP | 
					
						
							|  |  |  | Then you can invoke the snippet with \fIimport\fP: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PP | 
					
						
							|  |  |  | .RS | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .nf | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | import mysnippet | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | .fi | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .RE | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-24 12:37:27 +01:00
										 |  |  | .SH "EXAMPLES" | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .PP | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | Import a shared configuration: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .PP | 
					
						
							|  |  |  | .RS | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .nf | 
					
						
							|  |  |  | \&. { | 
					
						
							|  |  |  |    import config/common.conf | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | .fi | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .RE | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PP | 
					
						
							|  |  |  | Where \fB\fCconfig/common.conf\fR contains: | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .PP | 
					
						
							|  |  |  | .RS | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .nf | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | prometheus | 
					
						
							|  |  |  | errors | 
					
						
							|  |  |  | log | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | .fi | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .RE | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PP | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | This imports files found in the zones directory: | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | .PP | 
					
						
							|  |  |  | .RS | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | .nf | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | import ../zones/* | 
					
						
							| 
									
										
										
										
											2019-01-06 09:15:34 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | .fi | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .RE | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-05 13:37:38 +00:00
										 |  |  | .SH "SEE ALSO" | 
					
						
							| 
									
										
										
										
											2019-04-06 08:42:40 +01:00
										 |  |  | .PP | 
					
						
							|  |  |  | See corefile(5). | 
					
						
							|  |  |  | 
 |