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

dns: fix dnsutils #1330

Merged
merged 3 commits into from
Jul 22, 2022
Merged

Conversation

glazychev-art
Copy link
Contributor

@glazychev-art glazychev-art commented Jul 20, 2022

Signed-off-by: Artem Glazychev artem.glazychev@xored.com

Description

Fixes:

  1. Added UDP:
    Most DNS transactions take place over UDP - https://datatracker.ietf.org/doc/html/rfc5966

  2. Fix cache chain element - we need to store the whole dns.Question because QType is also important

This PR also adds some logs.

Issue link

How Has This Been Tested?

  • Added unit testing to cover
  • Tested manually
  • Tested by integration testing
  • Have not tested

Types of changes

  • Bug fix
  • New functionallity
  • Documentation
  • Refactoring
  • CI

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
@@ -44,7 +44,7 @@ func (h *dnsConfigsHandler) ServeDNS(ctx context.Context, rp dns.ResponseWriter,
for _, conf := range value {
ips := make([]url.URL, len(conf.DnsServerIps))
for i, ip := range conf.DnsServerIps {
ips[i] = url.URL{Scheme: "tcp", Host: ip}
ips[i] = url.URL{Scheme: "udp", Host: ip}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should support both schemes, because we don't know the right scheme

ips := make([]url.URL,0, len(conf.DnsServerIps) * 2)
for i, ip := range conf.DnsServerIps {
ips = append(ips, &url.URL{Scheme: "udp", Host: ip}
ips = append(ips, &url.URL{Scheme: "tcp", Host: ip}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@glazychev-art glazychev-art changed the title dns: use upd instead of tcp dns: use tcp and udp Jul 21, 2022
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
@glazychev-art glazychev-art marked this pull request as draft July 21, 2022 07:25
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
@glazychev-art glazychev-art changed the title dns: use tcp and udp dns: fix dnsutils Jul 22, 2022
@glazychev-art glazychev-art marked this pull request as ready for review July 22, 2022 08:42
@denis-tingaikin
Copy link
Member

It was quickly!

@denis-tingaikin denis-tingaikin merged commit cbf511a into networkservicemesh:main Jul 22, 2022
nsmbot pushed a commit to networkservicemesh/cmd-nsc-init that referenced this pull request Jul 22, 2022
…k@main

PR link: networkservicemesh/sdk#1330

Commit: cbf511a
Author: Artem Glazychev
Date: 2022-07-22 17:21:55 +0700
Message:
  - dns: fix dnsutils (#1330)
* dns: use upd instead of tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Add tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Fix cache chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-map-ip-k8s that referenced this pull request Jul 22, 2022
…k@main

PR link: networkservicemesh/sdk#1330

Commit: cbf511a
Author: Artem Glazychev
Date: 2022-07-22 17:21:55 +0700
Message:
  - dns: fix dnsutils (#1330)
* dns: use upd instead of tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Add tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Fix cache chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/sdk-kernel that referenced this pull request Jul 22, 2022
…k@main

PR link: networkservicemesh/sdk#1330

Commit: cbf511a
Author: Artem Glazychev
Date: 2022-07-22 17:21:55 +0700
Message:
  - dns: fix dnsutils (#1330)
* dns: use upd instead of tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Add tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Fix cache chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr that referenced this pull request Jul 22, 2022
…k@main

PR link: networkservicemesh/sdk#1330

Commit: cbf511a
Author: Artem Glazychev
Date: 2022-07-22 17:21:55 +0700
Message:
  - dns: fix dnsutils (#1330)
* dns: use upd instead of tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Add tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Fix cache chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-admission-webhook-k8s that referenced this pull request Jul 22, 2022
…k@main

PR link: networkservicemesh/sdk#1330

Commit: cbf511a
Author: Artem Glazychev
Date: 2022-07-22 17:21:55 +0700
Message:
  - dns: fix dnsutils (#1330)
* dns: use upd instead of tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Add tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Fix cache chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-registry-proxy-dns that referenced this pull request Jul 22, 2022
…k@main

PR link: networkservicemesh/sdk#1330

Commit: cbf511a
Author: Artem Glazychev
Date: 2022-07-22 17:21:55 +0700
Message:
  - dns: fix dnsutils (#1330)
* dns: use upd instead of tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Add tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Fix cache chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-ipam-vl3 that referenced this pull request Jul 22, 2022
…k@main

PR link: networkservicemesh/sdk#1330

Commit: cbf511a
Author: Artem Glazychev
Date: 2022-07-22 17:21:55 +0700
Message:
  - dns: fix dnsutils (#1330)
* dns: use upd instead of tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Add tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Fix cache chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr-proxy that referenced this pull request Jul 22, 2022
…k@main

PR link: networkservicemesh/sdk#1330

Commit: cbf511a
Author: Artem Glazychev
Date: 2022-07-22 17:21:55 +0700
Message:
  - dns: fix dnsutils (#1330)
* dns: use upd instead of tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Add tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Fix cache chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-registry-memory that referenced this pull request Jul 22, 2022
…k@main

PR link: networkservicemesh/sdk#1330

Commit: cbf511a
Author: Artem Glazychev
Date: 2022-07-22 17:21:55 +0700
Message:
  - dns: fix dnsutils (#1330)
* dns: use upd instead of tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Add tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Fix cache chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nse-remote-vlan that referenced this pull request Jul 22, 2022
…k@main

PR link: networkservicemesh/sdk#1330

Commit: cbf511a
Author: Artem Glazychev
Date: 2022-07-22 17:21:55 +0700
Message:
  - dns: fix dnsutils (#1330)
* dns: use upd instead of tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Add tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Fix cache chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/sdk-k8s that referenced this pull request Jul 22, 2022
…k@main

PR link: networkservicemesh/sdk#1330

Commit: cbf511a
Author: Artem Glazychev
Date: 2022-07-22 17:21:55 +0700
Message:
  - dns: fix dnsutils (#1330)
* dns: use upd instead of tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Add tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Fix cache chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nse-vfio that referenced this pull request Jul 22, 2022
…k@main

PR link: networkservicemesh/sdk#1330

Commit: cbf511a
Author: Artem Glazychev
Date: 2022-07-22 17:21:55 +0700
Message:
  - dns: fix dnsutils (#1330)
* dns: use upd instead of tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Add tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Fix cache chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nse-remote-vlan that referenced this pull request Jul 25, 2022
…k@main

PR link: networkservicemesh/sdk#1330

Commit: cbf511a
Author: Artem Glazychev
Date: 2022-07-22 17:21:55 +0700
Message:
  - dns: fix dnsutils (#1330)
* dns: use upd instead of tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Add tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Fix cache chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-cluster-info-k8s that referenced this pull request Jul 26, 2022
…k@main

PR link: networkservicemesh/sdk#1330

Commit: cbf511a
Author: Artem Glazychev
Date: 2022-07-22 17:21:55 +0700
Message:
  - dns: fix dnsutils (#1330)
* dns: use upd instead of tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Add tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Fix cache chain element

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
anastasia-malysheva pushed a commit to anastasia-malysheva/sdk that referenced this pull request Jul 27, 2022
* dns: use upd instead of tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Add tcp

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Fix cache chain element

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants