| 
									
										
										
										
											2016-09-17 17:09:05 +01:00
										 |  |  | # whoami
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-10 20:46:25 +01:00
										 |  |  | *whoami* returns your resolver's local IP address, port and transport. Your IP address is returned | 
					
						
							|  |  |  |  in the additional section as either an A or AAAA record. | 
					
						
							| 
									
										
										
										
											2016-09-17 17:09:05 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-20 09:47:43 +01:00
										 |  |  | When CoreDNS can not find a Corefile to load, this is the default plugin it loads. | 
					
						
							| 
									
										
										
										
											2017-10-10 09:39:35 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-10 20:46:25 +01:00
										 |  |  | The reply always has an empty answer section. The port and transport are included in the additional | 
					
						
							|  |  |  | section as a SRV record, transport can be "tcp" or "udp". | 
					
						
							| 
									
										
										
										
											2016-09-17 17:09:05 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | ~~~ txt | 
					
						
							|  |  |  | ._<transport>.qname. 0 IN SRV 0 0 <port> . | 
					
						
							|  |  |  | ~~~ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-14 09:36:06 +01:00
										 |  |  | If CoreDNS can't find a Corefile on startup this is the *default* plugin that gets loaded. As | 
					
						
							|  |  |  | such it can be used to check that CoreDNS is responding to queries. Other than that this plugin | 
					
						
							| 
									
										
										
										
											2017-09-10 20:46:25 +01:00
										 |  |  | is of limited use in production. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-14 09:36:06 +01:00
										 |  |  | The *whoami* plugin will respond to every A or AAAA query, regardless of the query name. | 
					
						
							| 
									
										
										
										
											2016-09-17 17:09:05 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | ## Syntax
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ~~~ txt | 
					
						
							|  |  |  | whoami | 
					
						
							|  |  |  | ~~~ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## Examples
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-14 09:36:06 +01:00
										 |  |  | Start a server on the default port and load the *whoami* plugin. | 
					
						
							| 
									
										
										
										
											2017-09-10 20:46:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | ~~~ corefile | 
					
						
							|  |  |  | . { | 
					
						
							| 
									
										
										
										
											2016-09-17 17:09:05 +01:00
										 |  |  |     whoami | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | ~~~ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | When queried for "example.org A", CoreDNS will respond with: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ~~~ txt | 
					
						
							|  |  |  | ;; QUESTION SECTION: | 
					
						
							|  |  |  | ;example.org.   IN       A | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ;; ADDITIONAL SECTION: | 
					
						
							|  |  |  | example.org.            0       IN      A       10.240.0.1 | 
					
						
							|  |  |  | _udp.example.org.       0       IN      SRV     0 0 40212 | 
					
						
							|  |  |  | ~~~ |