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

Fix CNAME handling a bit #19

Merged
merged 1 commit into from
Jan 20, 2017
Merged

Fix CNAME handling a bit #19

merged 1 commit into from
Jan 20, 2017

Commits on Jan 20, 2017

  1. Fix CNAME handling a bit

    If there's a CNAME in the list of RRs to return, _always_ put it in Answer (not Extra), regardless of the Question type.
    
    Additionally, when we perform recursive queries, our recursive query is what needs to be in the "name" field for the reply.
    
    Before:
    
    ```console
    $ dig ha.pool.sks-keyservers.net
    
    ; <<>> DiG 9.11.0-P2 <<>> ha.pool.sks-keyservers.net
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6632
    ;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
    ;; WARNING: recursion requested but not available
    
    ;; QUESTION SECTION:
    ;ha.pool.sks-keyservers.net.	IN	A
    
    ;; ANSWER SECTION:
    ha.pool.sks-keyservers.net. 0	IN	A	172.18.0.7
    
    ;; ADDITIONAL SECTION:
    ha.pool.sks-keyservers.net. 0	IN	CNAME	haproxy-sks.docker.
    
    ;; Query time: 1 msec
    ;; SERVER: 172.18.42.1#53(172.18.42.1)
    ;; WHEN: Fri Jan 20 12:56:19 PST 2017
    ;; MSG SIZE  rcvd: 144
    ```
    
    After:
    
    ```console
    $ dig ha.pool.sks-keyservers.net
    
    ; <<>> DiG 9.11.0-P2 <<>> ha.pool.sks-keyservers.net
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53265
    ;; flags: qr rd; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
    ;; WARNING: recursion requested but not available
    
    ;; QUESTION SECTION:
    ;ha.pool.sks-keyservers.net.	IN	A
    
    ;; ANSWER SECTION:
    ha.pool.sks-keyservers.net. 0	IN	CNAME	haproxy-sks.docker.
    haproxy-sks.docker.	0	IN	A	172.18.0.7
    
    ;; Query time: 1 msec
    ;; SERVER: 172.18.42.1#53(172.18.42.1)
    ;; WHEN: Fri Jan 20 13:07:19 PST 2017
    ;; MSG SIZE  rcvd: 136
    ```
    tianon committed Jan 20, 2017
    Configuration menu
    Copy the full SHA
    c0a41f8 View commit details
    Browse the repository at this point in the history