openrdap / rdap Goto Github PK
View Code? Open in Web Editor NEWRDAP command line client
Home Page: https://www.openrdap.org
License: MIT License
RDAP command line client
Home Page: https://www.openrdap.org
License: MIT License
When looking up a nameserver that doesn't exist and the server returns a 404 the RDAP client responds with:
cameron$ ~/go/bin/rdap --server=rdap.local -t nameserver ns1.nonexistantnameserver.net
# Error: No RDAP servers responded successfully (tried 1 server(s))
I'm wondering what support there is (if any) for SOCKS and HTTP proxies with the rdap
cli
In theory, to make an RDAP query, only HTTP protocol is required- unless there is some bootstrap mechanism that depends upon DNS (which I realize is possible)
I'm trying to use rdap
to look up network block metadata in a restrictive environment. To clarify the relevant restrictions:
CONNECT
in an HTTP proxyTo further clarify, I am not interested in WHOIS protocol (UDP/43) so no worries about supporting that
Here's what happens when I try to specify an HTTP proxy and hope for the best:
20:05:59 › HTTP_PROXY=http://127.0.0.1:3128 HTTPS_PROXY=http://127.0.0.1:3128 rdap 1.1.1.1
# Error: Get https://data.iana.org/rdap/ipv4.json: dial tcp: lookup data.iana.org on my.internal.resolver:53: no such host
Clearly in this case it's grabbing some bootstrap data via HTTP from IANA and not honoring my attempt at specifying a proxy. I'm stuck here because of the restrictions mentioned above
I have yet to look under the hood to see what HTTP package rdap
is using, but maybe you can save me some time and clarify:
Thanks!
Hello.
I am trying to access VCard property of LACNIC resources (for example, IPv4 address 148.223.0.0
), however it seems like openrdap/rdap package is unable to parse their response due to jCard error: jCard property too short (>=4 array elements required)
while decoding the VCard field.
Is this the intended behaviour or known issue?
fixed here - 50b68a8
I really like this tool. Is there any chance you could add a "tap" so it can be installed using homebrew? Instructions are here:
https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap
When using the -j/--json switch, no data is returned structured as json
user@host Desktop % ~/go/bin/rdap -v google.com -j
# OpenRDAP v0.0.1
#
# rdap: Configuring query...
# rdap: Using disk cache (/Users/a206709233/.openrdap)
# rdap: Bootstrap URL is default 'https://data.iana.org/rdap/'
# rdap: Bootstrap cache TTL set to 3600 seconds
# rdap: Timeout is 30 seconds
#
# client: Running...
# client: Request type : domain
# client: Request query : google.com
# client: Request URL : TBD, bootstrap required
# bootstrap: Looking up...
# bootstrap: Question type : dns
# bootstrap: Question query: google.com
# bootstrap: Cache state: dns.json: good
# bootstrap: Using cached Service Registry file
# bootstrap: Looked up 'google.com'
# bootstrap: Matching entry 'com'
# bootstrap: Service URL #1: 'https://rdap.verisign.com/com/v1/'
# client: RDAP URL #0 is https://rdap.verisign.com/com/v1/domain/google.com
# client: GET https://rdap.verisign.com/com/v1/domain/google.com
# client: status-code=200, content-type=application/rdap+json, length=2429 bytes, duration=353.50978ms
# client: Successfully decoded response
#
# rdap: Finished in 360.84536ms
I get a warning that the readme instructions are deprecated.
❯ ~/go/bin/rdap europa.eu
It appears to me that this openrdap only uses registry's response but the registrar's response, which typically provides more info (so called thick lookup), are missing. For example, if we rdap lookup google.com, the response don't have google location information which is only available from registrar's server.
I also tried -s url/of/registrar, for example rdap -s https://rdap.markmonitor.com/rdap google.com
but get 404 error.
Can you add the support of registrar's server url?
There hasn't been much activity here. I was curious if anyone is maintaining it. @skip2 ?
Even tho it's nice to have very detailed information I think it's kind of an overkill for "daily use" especially when doing normal domain or ip queries. For example, the whois record for google.com is 32 lines, while the openrdap result is 127. Therefore I think there should be a "compact" parameter where it only shows the more important information.
Those queries could
Last changed: <date>
)I know there's a whois parameter however I think this one contains a bit too less information. By doing some of the above things I could reduce the size to around 60 lines which I think is much better and faster readable
Hey,
I am not able to install rdap on Ubuntu 18.04 64bit desktop.
$ go version
go version go1.10.4 linux/amd64
$ echo $GOPATH
/home/XXX/go
$ go get -v -u github.com/openrdap/rdap
github.com/openrdap/rdap (download)
github.com/mitchellh/go-homedir (download)
Fetching https://golang.org/x/crypto/pkcs12?go-get=1
Parsing meta tags from https://golang.org/x/crypto/pkcs12?go-get=1 (status code 200)
get "golang.org/x/crypto/pkcs12": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/pkcs12?go-get=1
get "golang.org/x/crypto/pkcs12": verifying non-authoritative meta tag
Fetching https://golang.org/x/crypto?go-get=1
Parsing meta tags from https://golang.org/x/crypto?go-get=1 (status code 200)
golang.org/x/crypto (download)
Fetching https://golang.org/x/crypto/pkcs12/internal/rc2?go-get=1
Parsing meta tags from https://golang.org/x/crypto/pkcs12/internal/rc2?go-get=1 (status code 200)
get "golang.org/x/crypto/pkcs12/internal/rc2": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/pkcs12/internal/rc2?go-get=1
get "golang.org/x/crypto/pkcs12/internal/rc2": verifying non-authoritative meta tag
Fetching https://gopkg.in/alecthomas/kingpin.v2?go-get=1
Parsing meta tags from https://gopkg.in/alecthomas/kingpin.v2?go-get=1 (status code 200)
get "gopkg.in/alecthomas/kingpin.v2": found meta tag get.metaImport{Prefix:"gopkg.in/alecthomas/kingpin.v2", VCS:"git", RepoRoot:"https://gopkg.in/alecthomas/kingpin.v2"} at https://gopkg.in/alecthomas/kingpin.v2?go-get=1
gopkg.in/alecthomas/kingpin.v2 (download)
github.com/alecthomas/template (download)
github.com/alecthomas/units (download)
$ ls -la $GOPATH/bin/
total 9444
drwxr-xr-x 2 XXX XXX 4096 Dec 15 18:59 .
drwxr-xr-x 5 XXX XXX 4096 Dec 15 18:59 ..
-rwxr-xr-x 1 XXX XXX 9662331 Dec 15 19:00 goodls #another GO binary
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
$ uname -a
Linux XXX 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
This is exactly what I want but when I try using custom service url https://rdap.markmonitor.com/rdap
to respond to domain
query for google.com
, I get error No RDAP servers responded successfully (tried 1 server(s))
. Here is my code:
func CustomUsage() {
// Advanced usage:
//
// This demonstrates custom FetchRoles, a custom Context, a custom HTTP client,
// a custom Bootstrapper, and a custom timeout.
// // Nameserver query on rdap.nic.cz.
server, _ := url.Parse("https://rdap.markmonitor.com/rdap")
req := &rdap.Request{
Type: rdap.DomainRequest,
Query: "google.com",
//FetchRoles: []string{"all"},
//Timeout: time.Second * 45, // Custom timeout.
Server: server,
}
//fmt.Println(req.URL())
//req = req.WithContext(context.Context) // Custom context (see https://blog.golang.org/context).
client := &rdap.Client{}
//client.HTTP = &http.Client{} // Custom HTTP client.
//client.Bootstrap = &bootstrap.Client{} // Custom bootstapper.
resp, err := client.Do(req)
if err != nil {
fmt.Println(err.Error())
}
if ns, ok := resp.Object.(*rdap.Domain); ok {
fmt.Printf("Handle=%s Domain=%s\n", ns.Handle, ns.LDHName)
}
}
Thanks
Hi,
Do you plan on making binary release and versioning ? I would be interested to package it for my linux distribution and having a release either binary or link to a specific version could help me greatly.
We have some discussion about the proper formula name in this PR, here is the thread, it actually triggers me that why not name the repo into openrdap, just like what other openxxx do (openssh or openldap), this way I think it would be easier to push all the downstream package managers to use the openrdap rather than other names (right now it is a bit chaos). Let me know if that makes sense (I am also curious how we reached to this rdap rather than openrdap). Thanks!
lacnic has the possibility to use an api keys in order to access their rdap service. For example:
curl https://rdap.lacnic.net/rdap/ip/1.2.3.4?apikey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
will return the requested resource.
Here for more info:
https://www.lacnic.net/676/2/lacnic/request-rdap-access
Is it possible for your package to include an option to send the api-key when querying lacnic rdap?
Hi,
I see that there were several code changes since the last release, do you plan on having a new release anytime soon?
Thanks!
$go get -u github.com/openrdap/rdap/cmd/rdap
go: gopkg.in/alecthomas/[email protected]: parsing go.mod:
module declares its path as: github.com/alecthomas/kingpin/v2
but was required as: gopkg.in/alecthomas/kingpin.v2
$go version
go version go1.19.6 linux/amd64
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.