Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't disable DNS server in consul v0.8.4 with DNS port < 0 #3135

Closed
cwharvey opened this issue Jun 9, 2017 · 10 comments
Closed

can't disable DNS server in consul v0.8.4 with DNS port < 0 #3135

cwharvey opened this issue Jun 9, 2017 · 10 comments
Labels
theme/api Relating to the HTTP API interface type/bug Feature does not function as expected

Comments

@cwharvey
Copy link

cwharvey commented Jun 9, 2017

consul version for both Client and Server

Client: none
Server: v0.8.4

Server:

[Server `consul info` here]
agent:
        check_monitors = 0
        check_ttls = 0
        checks = 0
        services = 1
build:
        prerelease =
        revision = f436077
        version = 0.8.4
consul:
        bootstrap = false
        known_datacenters = 1
        leader = false
        leader_addr = 192.168.132.45:8300
        server = true
raft:
        applied_index = 21
        commit_index = 21
        fsm_pending = 0
        last_contact = 23.072296ms
        last_log_index = 21
        last_log_term = 117
        last_snapshot_index = 0
        last_snapshot_term = 0
        latest_configuration = [{Suffrage:Voter ID:6aeef61c-7772-83d8-977c-a7028810f8b5 Address:192.168.132.45:8300} {Suffrage:Voter ID:f77dd935-e0ec-2275-1f0e-ec8c12ed55a0 Address:192.168.132.43:8300} {Suffrage:Nonvoter ID:276f2c06-0c9d-f56e-d623-65ab0571eb54 Address:192.168.132.44:8300}]
        latest_configuration_index = 5
        num_peers = 1
        protocol_version = 3
        protocol_version_max = 3
        protocol_version_min = 0
        snapshot_version_max = 1
        snapshot_version_min = 0
        state = Follower
        term = 117
runtime:
        arch = amd64
        cpu_count = 2
        goroutines = 85
        max_procs = 2
        os = linux
        version = go1.8.3
serf_lan:
        coordinate_resets = 0
        encrypted = false
        event_queue = 0
        event_time = 2
        failed = 0
        health_score = 0
        intent_queue = 0
        left = 0
        member_time = 6
        members = 3
        query_queue = 0
        query_time = 1
serf_wan:
        coordinate_resets = 0
        encrypted = false
        event_queue = 0
        event_time = 1
        failed = 0
        health_score = 0
        intent_queue = 0
        left = 0
        member_time = 6
        members = 3
        query_queue = 0
        query_time = 1

### Operating system and Environment details
linux 64 bit contos 7

### Description of the Issue (and unexpected/desired result)
Can't seem to disable DNS server in consul v0.8.4

### Reproduction steps
create a consul.conf file with the following snippet:

        "ports":        {
                "dns":  -1,
                "https":        -1,
                "serf_lan":     8301,
                "serf_wan":     8302,
                "server":       8300
        }

start a server agent and note the following logs:

### Log Fragments
==> WARNING: Expect Mode enabled, expecting 2 servers
==> Starting Consul agent...
==> Error starting agent: agent: timeout starting DNS servers

(log_level = TRACE)

this used to work in consul v0.8.1, and setting the dns port to 0 works fine.


@slackpad
Copy link
Contributor

slackpad commented Jun 9, 2017

Thanks @TheLorax this looks like a possible regression - will look at this for the next release.

@slackpad slackpad added type/bug Feature does not function as expected theme/api Relating to the HTTP API interface labels Jun 9, 2017
@magiconair
Copy link
Contributor

Try setting the port to 0 instead of -1. That should disable it.

@magiconair
Copy link
Contributor

We'll fix it to require the port to be > 0 again.

@magiconair magiconair changed the title can't disable DNS server in consul v0.8.4 can't disable DNS server in consul v0.8.4 with DNS port < 0 Jun 9, 2017
@cwharvey
Copy link
Author

if I understand this fix correctly, it is no longer possible to not bind the DNS listen port in consul v0.8.4?

@preetapan
Copy link
Contributor

preetapan commented Jun 12, 2017 via email

@cwharvey
Copy link
Author

When I tried setting the port to 0 in v0.8.4 the DNS port was bound and the service was enabled, but on the default DNS port number. (8400 I think)

@preetapan
Copy link
Contributor

preetapan commented Jun 12, 2017

@TheLorax you are right, I was able to reproduce this in master setting dns to 0 using the above config (it still started it on port 8600). Setting it to -1 worked as expected and it didn't start a DNS server. For now, could you set your port to -1, (building consul from source).

@preetapan
Copy link
Contributor

I updated my comment above. I am relatively new, so apologies for the back and forth on this. If this is blocking you, I would recommend building consul master branch from source to be able to use your existing config file with "dns": -1 to turn off dns.

@magiconair
Copy link
Contributor

@preetapan is correct. I assumed 0 is disabled but it means enabled on default port (which is 8600 for DNS). So yes, in 0.8.4 you cannot disable the DNS server. You can either build from master, set it to some unused port or use firewall rules to prevent access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/api Relating to the HTTP API interface type/bug Feature does not function as expected
Projects
None yet
Development

No branches or pull requests

4 participants