hashicorp / hashicorp/consul

Windows Workstation DNS Configuration

Open
#3,964 5 comments 3 reactions 0 assignees View on GitHub
theme/dns theme/windows type/docs
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
2d 6h
Merged PRs (30d)
43

Description

### Description of the Issue (and unexpected/desired result)
As a windows software developer I want to be able to configure consul on my windows workstation to confirm the behaviour of consul independently of any existing DNS infrastructure, so I can confirm the develop windows software services behind consul.

As a windows software developer, I want to read the full set of instructions for using windows and consul without knowing too much about DNS configuration or Linux DNS command lines need to setup a basic server implementation.

At the moment the consul documentation is oriented at Linux environments and associated command lines, while the promoting the service as cross platform. In the on premise/cloud/hybrid world I need to understand how Consul fits into those models for customer who have chosen Windows infrastructure to host software.

### Reproduction steps
1. On a windows 10 enterprise workstation (or VM) install consul via https://chocolatey.org/packages/consul
2. Create consul.json and save it to C:\ProgramData\consul\config\consul.json
3. Edit the consul.json file and add the following
{
"server": true,
"ui": true,
"datacenter": "JamiesLaptopDC",
"acl_master_token": "thiscanbeanystring",
"data_dir": "C:\\%ProgramData%\\consul\\config",
"encrypt": "/hZH8NScRAUq883dImYGrg==",
"disable_keyring_file": true
}
3. Open powershell as administrator and confirm the configuration
`consul validate consul.json`
4. Confirm the IP address for the service
`Ipconfig /all`
5. Get the appropriate IP address to bind against and then run consul agent as a server
`consul agent -data-dir=C:\ProgramData\consul\config\ -config-file='consul.json' -bind #.#.#.# -bootstrap`
6. Confirm the http gui runs via powershell command line or open a web browser and navigate to http://localhost:8500/ui/
`consul agent -ui`
7. Confirm the dns resolution is working via powershell
`
nslookup
consul.service.consul
`
8. Confirm the DNS resolution on a windows works as expected.

Review the following windows powershell commands

**show rules**
`netsh interface portproxy show all`

**add tcp rule for consul - this persists between reboots**
`netsh interface portproxy add v4tov4 listenport=53 listenaddress=0.0.0.0 connectport=8600 connectaddress=127.0.0.1`

**remove rule**
`netsh interface portproxy delete v4tov4 listenport=53 listenaddress=0.0.0.0`

**Review active ports on windows**
`netstat -abno | Findstr 53`

**Try to force DNS lookup to consul**
`NSlookup

set port=8600

server 127.0.0.1

consul.service.consul`

### `consul version` for both Client and Server
Client: `1.0.3`
Server: `1.0.3`

### `consul info` for both Client and Server
Server:
```
Consul agent running!
Version: 'v1.0.3'
Node ID: '2c5a3f73-1ad5-6607-9dcb-a2232c98fbb9'
Node name: 'WC060504'
Datacenter: 'jamieslaptopdc' (Segment: '')
Server: true (Bootstrap: true)
Client Addr: [127.0.0.1] (HTTP: 8500, HTTPS: -1, DNS: 8600)
Cluster Addr: 10.1.64.138 (LAN: 8301, WAN: 8302)
Encrypt: Gossip: true, TLS-Outgoing: false, TLS-Incoming: false
```

### Operating system and Environment details
Windows 10 Enterprise 64 bit
Version: 1709
OS Build: 16299.248

### Log Fragments or Link to [gist](https://gist.github.com/)
localhost can't find consul.service.consul: No response from server

https://gitter.im/hashicorp-consul/Lobby - Discussion by @mit-jamie-clayton and @brahama around various commands to get DNS resolution working in the windows world.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.