Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for DNS in std::net #27705
Comments
alexcrichton
added
T-libs
B-unstable
labels
Aug 12, 2015
alexcrichton
referenced this issue
Aug 24, 2015
Open
Does getaddrinfo need to take the ENV lock? #27970
This comment has been minimized.
This comment has been minimized.
|
I’d like to I think a guiding principle in some other parts of I think the return value of |
aturon
added
the
I-nominated
label
Dec 16, 2015
This comment has been minimized.
This comment has been minimized.
|
@SimonSapin proposes stabilization for this cycle. |
This comment has been minimized.
This comment has been minimized.
|
The libs team discussed this during triage yesterday and the conclusion was to not move this into FCP just yet. I personally have a number of concerns about the API exposed here in that I think it's insufficient for exporting all the functionality we want and it's also insufficient for giving back all the information that we get. I would be interested in seeing this developed externally on crates.io and then perhaps move it into the standard library. For now the libstd support won't be deprecated until a replacement externally exists, but I may work on such a replacement in the near future if no one else gets around to it! |
alexcrichton
removed
the
I-nominated
label
Dec 17, 2015
This comment has been minimized.
This comment has been minimized.
|
+1 to everything @SimonSapin said. DNS is a mapping of names to IP addresses, not IP addresses+ports, so |
This comment has been minimized.
This comment has been minimized.
|
Should |
This comment has been minimized.
This comment has been minimized.
photino
commented
Mar 10, 2016
|
What is the decision on |
This comment has been minimized.
This comment has been minimized.
|
Whoops, missed @SimonSapin's comment. cc @rust-lang/libs -- the question is, given that we have stabilized |
aturon
added
the
I-nominated
label
Mar 10, 2016
This comment has been minimized.
This comment has been minimized.
|
Given that we haven't stabilized |
This comment has been minimized.
This comment has been minimized.
|
I’m suggesting to remove |
This comment has been minimized.
This comment has been minimized.
|
Regardless of the state of |
This comment has been minimized.
This comment has been minimized.
As we’ve discussed before, this can’t really happen since |
This comment has been minimized.
This comment has been minimized.
|
Fine, "I believe our feelings where that |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
I wanted to use lookup_host in something I was writing, so I went to the effort of pulling out all the relevant code, and making it use the libc crate (so it works on stable) - https://crates.io/crates/dns-lookup. It requires a bit of work to improve it though (documentation, testing, refactoring). It's still using SocketAddrs, but since IpAddr has been un-deprecated, the first change should probably be using IpAddr instead. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I feel that the death of As a result, I've created the |
This comment has been minimized.
This comment has been minimized.
|
I'm using it, so we're at least two. Well, at least I was, until it was removed. Sure, Also, when it comes to DNS, I really want to use the system/libc functions, not a pure Rust solution (because of caching, NSS, system settings ...). |
This comment has been minimized.
This comment has been minimized.
|
There hasn't been a lot of clear communication from the libs team on these APIs; sorry about that. The TL;DR is that no one is comfortable stabilizing these APIs as-is, and we prefer when possible to prototype and gain experience with this kind of thing outside of Luckily, for networking in particular, we already have a crate for this exact purpose: net2. It's a kind of staging ground for networking API experiments that are ultimately on track for |
This comment has been minimized.
This comment has been minimized.
|
That sounds good to me. I'm already using |
This comment has been minimized.
This comment has been minimized.
|
Note that |
nodakai
referenced this issue
Apr 3, 2016
Closed
No need to incite segregation between IPv4 and IPv6 #32
This comment has been minimized.
This comment has been minimized.
|
@nodakai I don't understand the emphasis on list. That said, |
This comment has been minimized.
This comment has been minimized.
|
The getaddrinfo systemcall can also give information about other protocols, like unix sockets. It also incorporates a query interface for what kinds of sockets you'd like. I'm building a simple wrapper for getaddrinfo to play with in the dns-lookup repo I made, and I might submit it as a pr to net2 if it's useful. |
This comment has been minimized.
This comment has been minimized.
|
The libs team discussed this at triage the other day, and the decision was to not move this issue to FCP yet but instead follow the strategy @aturon proposed earlier, which is to prototype these APIs in net2 first. |
alexcrichton
removed
the
I-nominated
label
Apr 29, 2016
This comment has been minimized.
This comment has been minimized.
kevinburke
commented
Oct 25, 2016
|
Apologies if this is the wrong place... recently I tried to get github.com/kevinburke/dnstimeout up and running again and ran into
If I am reading correctly, there is no current way to fix this issue (do DNS lookups) using Rust stable? Without using glibc or friends.. |
This comment has been minimized.
This comment has been minimized.
|
@kevinburke You can use the use std::net::ToSocketAddrs;
use std::io;
fn resolve(host: &str) -> io::Result<Vec<IpAddr>> {
(s, 0).to_socket_addrs().map(|iter| iter.map(|socket_address| socket_address.ip()).collect())
}… but this API does not support timeouts. |
This comment has been minimized.
This comment has been minimized.
fweimer
commented
Jan 7, 2017
|
|
Byron
referenced this issue
Mar 5, 2017
Open
Use `std::net::lookup_host` instead of `dns-lookup` crate #11
Mark-Simulacrum
added
the
C-tracking-issue
label
Jul 22, 2017
This comment has been minimized.
This comment has been minimized.
|
The story here is pretty clearly settled: you can use the @rfcbot fcp close |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Aug 29, 2017
•
|
Team member @aturon has proposed to close this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
rfcbot
added
the
proposed-final-comment-period
label
Aug 29, 2017
This comment has been minimized.
This comment has been minimized.
dimbleby
commented
Aug 29, 2017
I see two possible justifications for settling for this: one disappointing-but-reasonable, one surely wrong. I'd like to check which (if either) we have in mind when closing this. The 'disappointing-but-reasonable' position is: well, that's where we are. It's true that the The 'surely wrong' position is: this is actually where we'd want to be, and all is well with the world. The current I suspect that the first position is what is being proposed, in which case fair enough. But if it's the second, please leave a note so that I can come back and say why I think that's surely wrong and should be revisited! |
This comment has been minimized.
This comment has been minimized.
|
Neither of those options are the justification: The There is a place for a more robust and featureful DNS API in the standard library, but no one has cared about it enough to actually do any of that design or implementation work. |
This comment has been minimized.
This comment has been minimized.
dimbleby
commented
Aug 29, 2017
Isn't that saying exactly that the story is not yet settled? I mean that's also a reasonable position, but it seems to argue for keeping this issue open rather than for closing it. |
This comment has been minimized.
This comment has been minimized.
|
The story of the specific functions for which this is a tracking issue is proposed to be settled. Feature requests tend to live on the rfcs repo. |
This comment has been minimized.
This comment has been minimized.
fweimer
commented
Aug 30, 2017
|
I find the terminology here confusing. A lot of programmers need host name lookup, and they need to resolve host names according to the system configuration, which usually includes more than just DNS, and can end up performing exotics such as LDAP or NIS lookups. These kinds of lookups are limited in the types of data they can process (basically, just names, addresses, and, to some degree, host aliases). DNS, in contrast, offers a much wider range of record types, and a DNS API is required to get anything out of DNS which does not involve address information. But some names users expect to resolve on a system will not be resolvable through DNS, so a DNS API is not a replacement for something that ends up calling |
This comment has been minimized.
This comment has been minimized.
dimbleby
commented
Aug 30, 2017
|
So, if I may so so, the communication has not been entirely clear. But I think that the reasoning for closing this one is some combination of the 'disappointing-but-reasonable' position - essentially, that we are where we are and can't do much about that - and that: as a matter of policy, proposals to make things better no longer belong in this repository but instead should these days be tracked by RFCs. Right? Seems OK to me. (Though it's a bit annoying: I'm already watching this issue, and instead I am now expected to watch future and as yet non-existent proposals somewhere else...) @fweimer I can't tell whether you're in favour of closing this issue, or doing something else, or what. Care to expand? |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Sep 12, 2017
|
|
rfcbot
added
final-comment-period
and removed
proposed-final-comment-period
labels
Sep 12, 2017
This comment has been minimized.
This comment has been minimized.
|
Alright now that we've signed off, I'm going to close as per the review above. |
alexcrichton
closed this
Sep 17, 2017
This comment has been minimized.
This comment has been minimized.
|
Er actually, forgot that we still need to mark the apis deprecated.. |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
The intention was to get rid of all of it, so I think we'd just deprecate that as well. |
This comment has been minimized.
This comment has been minimized.
|
That’s fine, it just looks like one function slipped through the cracks. I meant re-open so we don’t forget it. |
This comment has been minimized.
This comment has been minimized.
|
Fixed in #47510. |
alexcrichton commentedAug 12, 2015
This is a tracking issue for the
lookup_addrandlookup_hostunstable features in the standard library. These are currently the only exposed support for DNS as a public interface. Functions likeTcpStream::connectalready expose the ability to resolve names via passing a string, but this cannot be done programmatically currently.There are a number of thorny issues to deal with here:
getaddrinfoandgetnameinfohere appropriate?getaddrinfocase, should IP addresses or socket addresses be returned?getnameinfocase, should IP addresses or socket addresses be taken?DirEntry)