Comments (14)
Quick update: I started the netdb crate and put together a preliminary implementation of get_host_by_name()
and its async companion, tentatively named poll_host_by_name()
. Needs testing and documenting and examples before it can go onto crates.io even in its really limited state, though.
from domain.
I tend to not want to support this in the domain
crate since it is intended for DNS only.
What I would like to do instead is start a new crate that mimics NSS and not only considers /etc/hosts
but also /etc/nsswitch.conf
and perhaps even allows binding NSS .so
libraries. An initial version could only provide name resolution with DNS and the hosts file, to make this functionality available quickly.
How does that sound?
from domain.
i think it is not easy to program, because of we don't know the end-user's system environment, there must someone want to use hosts file directly, like me? As a programmer, we should use two crates's functions to resolve the host name? i suggest integrated into domain, just like c api, gethostbyname
from domain.
from domain.
Binding to .so
in async program doesn't make sense. Either use gethostbyname()
directly (in a thread) or make normal async resolver with things that's possible to do asynchronously.
from domain.
In pretty much all setups the nsswitch.conf
entry for hosts is effectively files dns
(safe for alternative resolvers which can be translated into appropriate domain
configuration once it supports whatever additional functionality those resolvers provide). It would still be nice if packages could behave correctly in the fraction of cases that differ. For instance, if I removed the files
entry from nsswitch.conf
(because I have a complex hosts
file which I want to disable temporarily), it would be nice it Things Just Worked.
For async use, the .so
bindings could be forked into a thread pool.
from domain.
Well, here is the stock nsswitch.conf
from nix:
hosts: files dns myhostname mymachines
mdns
and mdns_minimal
are also common (as allows service discovery, e.g. to find printers as easy as on other OSs)
systemd
is also going to gain popularity just because it's installed everywhere
I'm not sure about ldap
from domain.
Most of this should be supported by the new crate natively, perhaps even ldap
if we have an underlying crate for it—a protocol as complex as LDAP would particularly benefit from using a Rust implementation.
from domain.
Yes. That would be great. But it's a hell of a lot of work :)
from domain.
I’m happy to at least get started. I am somewhat busy with life stuff the next weeks, though, but I’ll start a crate that pulls together the hosts file stuff (a parser for which actually is already present in domain
) and the resolver, sometime soon. That will hopefully solve @Matrix-Zhang’s use case and then we can see where we go from there.
from domain.
I see, thanks for your hard wrok
from domain.
@partim what's the status of netdb
crate?
from domain.
I’ve been caught up in moving the last two weeks but things have calmed down now. Hoping to get the remaining stuff done perhaps this weekend already, otherwise early next week.
from domain.
Version 0.1.0 of netdb
has just been uploaded to crates.io
. It really only is a start just now, but it should allow closing this issue.
from domain.
Related Issues (14)
- Could not compile domain HOT 3
- Resolver configuration on Windows HOT 4
- Limit iteration for decompressing domain names
- It returns gibberish HOT 14
- Setting DNS information for Windows HOT 1
- Any plans to publish on crates.io? HOT 3
- Crashed in Query HOT 5
- Couldn't build on nightly HOT 1
- Query DNS records directly? HOT 1
- Name compression must consider case
- Change master file scanner to operate on `char`. HOT 1
- `DNameBuf::with_capactity` misspelled
- Failed to compile with tokio-core v0.1.6 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from domain.