mirror of
				https://github.com/coredns/coredns.git
				synced 2025-11-03 18:53:13 -05:00 
			
		
		
		
	mw/whoami: update docs (#1054)
* mw/whoami: update docs Parse the corefile in the readme_test.go and other tweaks to the docs. Fixes #1049 * trailing * remove the 53 port
This commit is contained in:
		@@ -1,15 +1,19 @@
 | 
				
			|||||||
# whoami
 | 
					# whoami
 | 
				
			||||||
 | 
					
 | 
				
			||||||
*whoami* returns your local IP address, port and transport used. Your local IP address is returned in
 | 
					*whoami* returns your resolver's local IP address, port and transport. Your IP address is returned
 | 
				
			||||||
the additional section as either an A or AAAA record.
 | 
					 in the additional section as either an A or AAAA record.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The port and transport are included in the additional section as a SRV record, transport can be
 | 
					The reply always has an empty answer section. The port and transport are included in the additional
 | 
				
			||||||
"tcp" or "udp".
 | 
					section as a SRV record, transport can be "tcp" or "udp".
 | 
				
			||||||
 | 
					
 | 
				
			||||||
~~~ txt
 | 
					~~~ txt
 | 
				
			||||||
._<transport>.qname. 0 IN SRV 0 0 <port> .
 | 
					._<transport>.qname. 0 IN SRV 0 0 <port> .
 | 
				
			||||||
~~~
 | 
					~~~
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					If CoreDNS can't find a Corefile on startup this is the *default* middleware that gets loaded. As
 | 
				
			||||||
 | 
					such it can be used to check that CoreDNS is responding to queries. Other than that this middleware
 | 
				
			||||||
 | 
					is of limited use in production.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The *whoami* middleware will respond to every A or AAAA query, regardless of the query name.
 | 
					The *whoami* middleware will respond to every A or AAAA query, regardless of the query name.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Syntax
 | 
					## Syntax
 | 
				
			||||||
@@ -20,8 +24,10 @@ whoami
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
## Examples
 | 
					## Examples
 | 
				
			||||||
 | 
					
 | 
				
			||||||
~~~ txt
 | 
					Start a server on the default port and load the *whoami* middleware.
 | 
				
			||||||
.:53 {
 | 
					
 | 
				
			||||||
 | 
					~~~ corefile
 | 
				
			||||||
 | 
					. {
 | 
				
			||||||
    whoami
 | 
					    whoami
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
~~~
 | 
					~~~
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user