mirror of
https://github.com/cunnie/sslip.io.git
synced 2025-10-05 15:46:50 +08:00
BOSH release: 2.2.2: ip.sslip.io
TXT returns IP
Our documentation was wrong; our homepage said to get the origin IP address by querying the TXT record of the root, i.e. `dig @ns-aws.nono.io txt . +short`; however, our code worked differently: it returned the origin IP when the `.ip` TLD was queried. The new behavior is that it returns the origin IP when `ip.sslip.io.` is queried, and the documentation now reflects that behavior. Also, that behavior is marked "experimental" to give us leeway to change. [fixes #11]
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
cd $DIR/../src/sslip.io-dns-server
|
||||
ldflags="-X xip/xip.VersionSemantic=2.2.1 \
|
||||
ldflags="-X xip/xip.VersionSemantic=2.2.2 \
|
||||
-X xip/xip.VersionDate=$(date +%Y/%m/%d-%H:%M:%S%z) \
|
||||
-X xip/xip.VersionGitHash=$(git rev-parse --short HEAD)"
|
||||
export GOOS GOARCH
|
||||
|
@@ -3,6 +3,10 @@ builds:
|
||||
version: 037e9cbd3401e13b101d8345ed35dd9f11e677d1a8ad32f61bd390c732b1f9b6
|
||||
blobstore_id: d07828f0-f4ff-4966-7a52-fa25d3eba096
|
||||
sha1: sha256:3b5eacdc0776df52ba6a4ecc73b3bc2f3f705cc09c26eecf0547a73405f62e71
|
||||
0abc8073d5bd4d8907e6ca0c3b61cfa8aa4638accfc76b47b5681b0a01a882a5:
|
||||
version: 0abc8073d5bd4d8907e6ca0c3b61cfa8aa4638accfc76b47b5681b0a01a882a5
|
||||
blobstore_id: ceaecfb8-3e3a-4c72-617f-3707fea7d76e
|
||||
sha1: sha256:341159072960b7d64e2cec964061f18bbbf300be5b8f343fe1dd2e6a6584b560
|
||||
11ca4e8219df8887655a3aa2c81c3008a2179b9259ca9e735e51aeb1cc874efb:
|
||||
version: 11ca4e8219df8887655a3aa2c81c3008a2179b9259ca9e735e51aeb1cc874efb
|
||||
blobstore_id: 19c01669-1c49-425d-4563-ed07fc743ef7
|
||||
|
@@ -5,9 +5,9 @@ source /var/vcap/packages/golang-1-linux/bosh/compile.env
|
||||
mkdir src ${BOSH_INSTALL_TARGET}/bin
|
||||
mv sslip.io-dns-server/{go.*,main.go,xip} src/
|
||||
cd src/
|
||||
ldflags="-X xip/xip.VersionSemantic=2.2.1 \
|
||||
ldflags="-X xip/xip.VersionSemantic=2.2.2 \
|
||||
-X xip/xip.VersionDate=$(date +%Y/%m/%d-%H:%M:%S%z) \
|
||||
-X xip/xip.VersionGitHash=5227199"
|
||||
-X xip/xip.VersionGitHash=30d2c8a"
|
||||
go build \
|
||||
-ldflags="$ldflags" \
|
||||
-o ${BOSH_INSTALL_TARGET}/bin/sslip.io-dns-server
|
||||
|
@@ -27,6 +27,8 @@ builds:
|
||||
version: 2.2.0
|
||||
9d4b45ca-7a96-44c8-61dc-35f5b7f20b97:
|
||||
version: 1.2.2
|
||||
a843b20d-5cb5-498a-63d6-28d9fc42b724:
|
||||
version: 2.2.2
|
||||
aee53e95-768b-426f-64a1-0d74d458a0a6:
|
||||
version: 1.1.2
|
||||
d1f0f246-7316-49b9-7620-e9900d9e791e:
|
||||
|
23
bosh-release/releases/sslip.io/sslip.io-2.2.2.yml
Normal file
23
bosh-release/releases/sslip.io/sslip.io-2.2.2.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
name: sslip.io
|
||||
version: 2.2.2
|
||||
commit_hash: 5da6511
|
||||
uncommitted_changes: false
|
||||
jobs:
|
||||
- name: sslip.io-dns-server
|
||||
version: 308acb7c186a042bc2ca4c28b83c9fe7589a64c48ab6a11869c442bcaea8fdf9
|
||||
fingerprint: 308acb7c186a042bc2ca4c28b83c9fe7589a64c48ab6a11869c442bcaea8fdf9
|
||||
sha1: sha256:6ca6f2c11816a82ecb3cf9300ea59369977cbaa7c39eddca35628a7c6b9b5b45
|
||||
packages:
|
||||
- sslip.io-dns-server
|
||||
packages:
|
||||
- name: golang-1-linux
|
||||
version: 92655dbac2d36906f0d761ab03f2eb6bfa9a22730d8f1591a1acb7a6de875ed4
|
||||
fingerprint: 92655dbac2d36906f0d761ab03f2eb6bfa9a22730d8f1591a1acb7a6de875ed4
|
||||
sha1: sha256:e09c7eb7e88462113fdf2095d1ab0d4b9aed0dfd26cdda19744a47f006f6fe7c
|
||||
dependencies: []
|
||||
- name: sslip.io-dns-server
|
||||
version: 0abc8073d5bd4d8907e6ca0c3b61cfa8aa4638accfc76b47b5681b0a01a882a5
|
||||
fingerprint: 0abc8073d5bd4d8907e6ca0c3b61cfa8aa4638accfc76b47b5681b0a01a882a5
|
||||
sha1: sha256:341159072960b7d64e2cec964061f18bbbf300be5b8f343fe1dd2e6a6584b560
|
||||
dependencies:
|
||||
- golang-1-linux
|
@@ -113,11 +113,11 @@ var _ = Describe("sslip.io-dns-server", func() {
|
||||
"@127.0.0.1 version.sslip.io txt +short",
|
||||
`\A"dev"\n"today"\n"xxx"\n\z`,
|
||||
`TypeTXT version.sslip.io. \? \["dev"\], \["today"\], \["xxx"\]`),
|
||||
Entry(`TXT is the querier's IPv4 address and the TLD is "ip."`,
|
||||
"@127.0.0.1 blah.blah.ip txt +short",
|
||||
Entry(`TXT is the querier's IPv4 address and the domain "ip.sslip.io"`,
|
||||
"@127.0.0.1 ip.sslip.io txt +short",
|
||||
`127.0.0.1`,
|
||||
`TypeTXT blah.blah.ip. \? \["127.0.0.1"\]`),
|
||||
Entry(`TXT is the querier's IPv4 address and the TLD is NOT "ip."`,
|
||||
`TypeTXT ip.sslip.io. \? \["127.0.0.1"\]`),
|
||||
Entry(`TXT is the querier's IPv4 address and the domain is NOT "ip.sslip.io"`,
|
||||
"@127.0.0.1 example.com txt +short",
|
||||
`\A\z`,
|
||||
`TypeTXT example.com. \? nil, SOA example.com. briancunnie.gmail.com. 2021080200 900 900 1800 300\n$`),
|
||||
@@ -128,13 +128,13 @@ var _ = Describe("sslip.io-dns-server", func() {
|
||||
cmd := exec.Command("ping6", "-c", "1", "::1")
|
||||
err := cmd.Run() // if the command succeeds, we have IPv6
|
||||
if err == nil {
|
||||
It("returns a TXT of the querier's IPv6 address when there are no custom/acme records", func() {
|
||||
digCmd = exec.Command("dig", "@::1", "ip.", "txt", "+short")
|
||||
It("returns a TXT of the querier's IPv6 address when querying ip.sslip.io", func() {
|
||||
digCmd = exec.Command("dig", "@::1", "ip.sslip.io", "txt", "+short")
|
||||
digSession, err = Start(digCmd, GinkgoWriter, GinkgoWriter)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Eventually(digSession, 1).Should(Exit(0))
|
||||
Eventually(string(digSession.Out.Contents())).Should(MatchRegexp(`::1`))
|
||||
Eventually(serverSession.Err).Should(Say(`TypeTXT ip\. \? \["::1"\]`))
|
||||
Eventually(serverSession.Err).Should(Say(`TypeTXT ip\.sslip\.io\. \? \["::1"\]`))
|
||||
Expect(digSession).To(Exit())
|
||||
})
|
||||
}
|
||||
|
@@ -26,7 +26,9 @@ type DomainCustomization struct {
|
||||
AAAA []dnsmessage.AAAAResource
|
||||
CNAME dnsmessage.CNAMEResource
|
||||
MX []dnsmessage.MXResource
|
||||
TXT []dnsmessage.TXTResource
|
||||
TXT func(string) ([]dnsmessage.TXTResource, error)
|
||||
// Unlike the other record types, TXT is a function in order to enable more complex behavior
|
||||
// e.g. IP address of the query's source
|
||||
}
|
||||
|
||||
type DomainCustomizations map[string]DomainCustomization
|
||||
@@ -41,7 +43,6 @@ var (
|
||||
// https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses
|
||||
ipv6RE = regexp.MustCompile(`(^|[.-])(([0-9a-fA-F]{1,4}-){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}-){1,7}-|([0-9a-fA-F]{1,4}-){1,6}-[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}-){1,5}(-[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}-){1,4}(-[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}-){1,3}(-[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}-){1,2}(-[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}-((-[0-9a-fA-F]{1,4}){1,6})|-((-[0-9a-fA-F]{1,4}){1,7}|-)|fe80-(-[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]+|--(ffff(-0{1,4})?-)?((25[0-5]|(2[0-4]|1?[0-9])?[0-9])\.){3}(25[0-5]|(2[0-4]|1?[0-9])?[0-9])|([0-9a-fA-F]{1,4}-){1,4}-((25[0-5]|(2[0-4]|1?[0-9])?[0-9])\.){3}(25[0-5]|(2[0-4]|1?[0-9])?[0-9]))($|[.-])`)
|
||||
dns01ChallengeRE = regexp.MustCompile(`(?i)_acme-challenge\.`)
|
||||
ipDomainRE = regexp.MustCompile(`(^|\.)ip\.$`)
|
||||
nsAws, _ = dnsmessage.NewName("ns-aws.nono.io.")
|
||||
nsAzure, _ = dnsmessage.NewName("ns-azure.nono.io.")
|
||||
nsGce, _ = dnsmessage.NewName("ns-gce.nono.io.")
|
||||
@@ -80,12 +81,14 @@ var (
|
||||
MX: mx2,
|
||||
},
|
||||
},
|
||||
// Although multiple TXT records with multiple strings are allowed, we're sticking
|
||||
// with a multiple TXT records with a single string apiece because that's what ProtonMail requires
|
||||
// and that's what google.com does.
|
||||
TXT: []dnsmessage.TXTResource{
|
||||
{TXT: []string{"protonmail-verification=ce0ca3f5010aa7a2cf8bcc693778338ffde73e26"}}, // ProtonMail verification; don't delete
|
||||
{TXT: []string{"v=spf1 include:_spf.protonmail.ch mx ~all"}}, // Sender Policy Framework
|
||||
TXT: func(_ string) ([]dnsmessage.TXTResource, error) {
|
||||
// Although multiple TXT records with multiple strings are allowed, we're sticking
|
||||
// with a multiple TXT records with a single string apiece because that's what ProtonMail requires
|
||||
// and that's what google.com does.
|
||||
return []dnsmessage.TXTResource{
|
||||
{TXT: []string{"protonmail-verification=ce0ca3f5010aa7a2cf8bcc693778338ffde73e26"}}, // ProtonMail verification; don't delete
|
||||
{TXT: []string{"v=spf1 include:_spf.protonmail.ch mx ~all"}},
|
||||
}, nil // Sender Policy Framework
|
||||
},
|
||||
},
|
||||
// a global nameserver for sslip.io, a conglomeration of ns-{aws,azure,gce}.nono.io
|
||||
@@ -120,11 +123,17 @@ var (
|
||||
CNAME: dkim3,
|
||||
},
|
||||
},
|
||||
// Special-purpose TXT records
|
||||
"ip.sslip.io.": {
|
||||
TXT: ipSslipIo,
|
||||
},
|
||||
"version.sslip.io.": {
|
||||
TXT: []dnsmessage.TXTResource{
|
||||
{TXT: []string{VersionSemantic}}, // e.g. "2.2.1'
|
||||
{TXT: []string{VersionDate}}, // e.g. "2021/10/03-15:08:54+0100"
|
||||
{TXT: []string{VersionGitHash}}, // e.g. "9339c0d"
|
||||
TXT: func(_ string) ([]dnsmessage.TXTResource, error) {
|
||||
return []dnsmessage.TXTResource{
|
||||
{TXT: []string{VersionSemantic}}, // e.g. "2.2.1'
|
||||
{TXT: []string{VersionDate}}, // e.g. "2021/10/03-15:08:54+0100"
|
||||
{TXT: []string{VersionGitHash}}, // e.g. "9339c0d"
|
||||
}, nil
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -214,8 +223,7 @@ func QueryResponse(queryBytes []byte, sourceAddr net.IP) (responseBytes []byte,
|
||||
return responseBytes, logMessage, nil
|
||||
}
|
||||
|
||||
func processQuestion(q dnsmessage.Question, response *Response, sourceAddr net.IP) (logMessage string, _ error) {
|
||||
var err error
|
||||
func processQuestion(q dnsmessage.Question, response *Response, sourceAddr net.IP) (logMessage string, err error) {
|
||||
logMessage = q.Type.String() + " " + q.Name.String() + " ? "
|
||||
if IsAcmeChallenge(q.Name.String()) { // thanks @NormanR
|
||||
// delegate everything to its stripped (remove "_acme-challenge.") address, e.g.
|
||||
@@ -431,10 +439,9 @@ func processQuestion(q dnsmessage.Question, response *Response, sourceAddr net.I
|
||||
return logMessage + "nil, NS " + strings.Join(logMessages, ", "), nil
|
||||
}
|
||||
var txts []dnsmessage.TXTResource
|
||||
txts = TXTResources(q.Name.String())
|
||||
if len(txts) == 0 && ipDomainRE.MatchString(q.Name.String()) {
|
||||
// If there are no custom txt resources & TLD is `ip.`, return the source IP addr
|
||||
txts = []dnsmessage.TXTResource{{TXT: []string{sourceAddr.String()}}}
|
||||
txts, err = TXTResources(q.Name.String(), sourceAddr.String())
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
response.Answers = append(response.Answers,
|
||||
// 1 or more TXT records via Customizations
|
||||
@@ -680,11 +687,11 @@ func NSResources(fqdnString string) []dnsmessage.NSResource {
|
||||
}
|
||||
|
||||
// TXTResources returns TXT records from Customizations
|
||||
func TXTResources(fqdnString string) []dnsmessage.TXTResource {
|
||||
if domain, ok := Customizations[strings.ToLower(fqdnString)]; ok {
|
||||
return domain.TXT
|
||||
func TXTResources(fqdn, querier string) ([]dnsmessage.TXTResource, error) {
|
||||
if domain, ok := Customizations[strings.ToLower(fqdn)]; ok {
|
||||
return domain.TXT(querier)
|
||||
}
|
||||
return nil
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func SOAAuthority(name dnsmessage.Name) (dnsmessage.ResourceHeader, dnsmessage.SOAResource) {
|
||||
@@ -711,6 +718,11 @@ func SOAResource(name dnsmessage.Name) dnsmessage.SOAResource {
|
||||
}
|
||||
}
|
||||
|
||||
// when TXT for "ip.sslip.io" is queried, return the IP address of the querier
|
||||
func ipSslipIo(sourceIP string) ([]dnsmessage.TXTResource, error) {
|
||||
return []dnsmessage.TXTResource{{TXT: []string{sourceIP}}}, nil
|
||||
}
|
||||
|
||||
// soaLogMessage returns an easy-to-read string for logging SOA Answers/Authorities
|
||||
func soaLogMessage(soaResource dnsmessage.SOAResource) string {
|
||||
return soaResource.NS.String() + " " +
|
||||
|
@@ -148,30 +148,40 @@ var _ = Describe("Xip", func() {
|
||||
})
|
||||
|
||||
Describe("TXTResources()", func() {
|
||||
It("returns an empty array", func() {
|
||||
It("returns an empty array for a random domain", func() {
|
||||
randomDomain := random8ByteString() + ".com."
|
||||
txts := xip.TXTResources(randomDomain)
|
||||
txts, err := xip.TXTResources(randomDomain, "9.9.9.9")
|
||||
Expect(err).To(Not(HaveOccurred()))
|
||||
Expect(len(txts)).To(Equal(0))
|
||||
})
|
||||
When("queried for the sslip.io domain", func() {
|
||||
It("returns mail-related TXT resources for the sslip.io domain", func() {
|
||||
domain := "ssLip.iO."
|
||||
txts := xip.TXTResources(domain)
|
||||
txts, err := xip.TXTResources(domain, "8.8.8.8")
|
||||
Expect(err).To(Not(HaveOccurred()))
|
||||
Expect(len(txts)).To(Equal(2))
|
||||
Expect(txts[0].TXT[0]).To(MatchRegexp("protonmail-verification="))
|
||||
Expect(txts[1].TXT[0]).To(MatchRegexp("v=spf1"))
|
||||
})
|
||||
})
|
||||
When("a domain has been customized", func() { // Unnecessary, but confirms Golang's behavior for me, a doubting Thomas
|
||||
When("a random domain has been customized w/out any TXT defaults", func() { // Unnecessary, but confirms Golang's behavior for me, a doubting Thomas
|
||||
customizedDomain := random8ByteString() + ".com."
|
||||
xip.Customizations[customizedDomain] = xip.DomainCustomization{}
|
||||
It("returns no TXT resources", func() {
|
||||
txts := xip.TXTResources(customizedDomain)
|
||||
txts, err := xip.TXTResources(customizedDomain, "1.1.1.1")
|
||||
Expect(err).To(Not(HaveOccurred()))
|
||||
Expect(len(txts)).To(Equal(0))
|
||||
})
|
||||
delete(xip.Customizations, customizedDomain) // clean-up
|
||||
})
|
||||
When(`the domain "ip.sslip.io" is queried`, func() {
|
||||
It("returns the IP address of the querier", func() {
|
||||
txts, err := xip.TXTResources("ip.sslip.io.", "1.1.1.1")
|
||||
Expect(err).To(Not(HaveOccurred()))
|
||||
Expect(len(txts)).To(Equal(1))
|
||||
Expect(txts[0].TXT[0]).To(MatchRegexp("^1.1.1.1$"))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Describe("NameToA()", func() {
|
||||
|
@@ -4,8 +4,8 @@ These instructions are meant primarily for me when deploying a new BOSH release;
|
||||
they might not make sense unless you're on my workstation.
|
||||
|
||||
```zsh
|
||||
export OLD_VERSION=2.2.0
|
||||
export VERSION=2.2.1
|
||||
export OLD_VERSION=2.2.1
|
||||
export VERSION=2.2.2
|
||||
cd ~/workspace/sslip.io
|
||||
git pull -r --autostash
|
||||
# update the version number for the TXT record for version.sslip.io
|
||||
@@ -13,7 +13,9 @@ sed -i '' "s/$OLD_VERSION/$VERSION/g" \
|
||||
bin/make_all \
|
||||
bosh-release/packages/sslip.io-dns-server/packaging
|
||||
# update the download instructions on the website
|
||||
sed -i '' "s~/$OLD_VERSION/~/$VERSION/~g" k8s/document_root/index.html
|
||||
sed -i '' "s~/$OLD_VERSION/~/$VERSION/~g" \
|
||||
k8s/document_root/index.html \
|
||||
k8s/Dockerfile-sslip.io-dns-server
|
||||
# update the git hash for the TXT record for version.sslip.io for BOSH release
|
||||
sed -i '' "s/VersionGitHash=[0-9a-fA-F]*/VersionGitHash=$(git rev-parse --short HEAD)/g" \
|
||||
bosh-release/packages/sslip.io-dns-server/packaging
|
||||
@@ -44,12 +46,12 @@ dig a _Acme-ChallengE.127-0-0-1.sslip.io @$IP | grep "^127"
|
||||
echo "127-0-0-1.sslip.io. 604800 IN A 127.0.0.1"
|
||||
dig +short sSlIp.Io
|
||||
echo 78.46.204.247
|
||||
dig @ns-aws.nono.io txt . +short | tr -d '"'
|
||||
dig @$IP txt ip.sslip.io +short | tr -d '"'
|
||||
curl curlmyip.org; echo
|
||||
dig @$IP txt version.sslip.io +short | grep $VERSION
|
||||
echo "\"$VERSION\""
|
||||
git add -p
|
||||
git ci -vm"BOSH release: 2.2.0: TXT records return IP addrs"
|
||||
git ci -vm"BOSH release: 2.2.2: TXT records return IP addrs"
|
||||
bosh upload-blobs
|
||||
bosh create-release \
|
||||
--final \
|
||||
|
@@ -26,7 +26,7 @@ LABEL maintainer="brian.cunnie@gmail.com"
|
||||
RUN apk update && apk add bind-tools
|
||||
|
||||
ARG TARGETARCH # amd64, arm64 (so I can run on AWS graviton2)
|
||||
RUN wget https://github.com/cunnie/sslip.io/releases/download/2.2.1/sslip.io-dns-server-linux-$TARGETARCH \
|
||||
RUN wget https://github.com/cunnie/sslip.io/releases/download/2.2.2/sslip.io-dns-server-linux-$TARGETARCH \
|
||||
-O /usr/sbin/sslip.io-dns-server; \
|
||||
chmod 755 /usr/sbin/sslip.io-dns-server
|
||||
|
||||
|
@@ -50,7 +50,7 @@ src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]-->
|
||||
"https://ci.nono.io/api/v1/pipelines/sslip.io/jobs/dns-servers/badge" alt="ci.nono.io"></a> <sup><a href=
|
||||
"#status" class="alert-link">[Status]</a></sup></p>
|
||||
<p><em>sslip.io</em> is a DNS (<a href="https://en.wikipedia.org/wiki/Domain_Name_System">Domain Name System</a>)
|
||||
service that, when queried with a hostname with an embedded IP address, returns that IP Address. It was inspired
|
||||
service that, when queried with a hostname with an embedded IP address, returns that IP address. It was inspired
|
||||
by <a href="http://xip.io">xip.io</a>, which was created by <a href="https://github.com/sstephenson">Sam
|
||||
Stephenson</a>.</p>
|
||||
<div class="alert alert-success" role="alert">
|
||||
@@ -160,7 +160,7 @@ src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]-->
|
||||
example, we install & run our server within a docker container:</p>
|
||||
<pre>
|
||||
docker run -it --rm fedora
|
||||
curl -L https://github.com/cunnie/sslip.io/releases/download/2.2.1/sslip.io-dns-server-linux-amd64 -o dns-server
|
||||
curl -L https://github.com/cunnie/sslip.io/releases/download/2.2.2/sslip.io-dns-server-linux-amd64 -o dns-server
|
||||
chmod +x dns-server
|
||||
./dns-server 2> dns-server.log &
|
||||
dnf install -y bind-utils
|
||||
@@ -190,15 +190,21 @@ dig @localhost 127-0-0-1.sslip.io +short # returns "127.0.0.1"</pre>
|
||||
<p>if you're interested in acquiring a wildcard certificate for your sslip.io domain, e.g.
|
||||
"*.52-0-56-137.sslip.io", the procedure is described <a href=
|
||||
"https://github.com/cunnie/sslip.io/blob/master/docs/wildcard.md">here</a>.</p>
|
||||
<h3 id="whatismyip">Determining Your External IP Address via DNS Lookup</h3>
|
||||
<h3 id="experimental">Experimental Features</h3>
|
||||
<p>Experimental features can change; don't depend on them.</p>
|
||||
<h4 id="whatismyip">Determining Your External IP Address via DNS Lookup</h4>
|
||||
<p>You can use sslip.io's DNS servers (<code>ns-aws.nono.io</code>, <code>ns-azure.nono.io</code>,
|
||||
<code>ns-gce.nono.io</code>) to determine your public IP address by querying the <code>TXT</code> record of the
|
||||
root domain. If you're curious about your public IPv6 address, use the DNS server <code>ns-aws.nono.io</code>,
|
||||
for it has both IPv4 and IPv6 addresses:</p>
|
||||
<code>ns-gce.nono.io</code>) to determine your public IP address by querying the <code>TXT</code> record of
|
||||
<code>ip.sslip.io</code>. If you're curious about your public IPv6 address, use the DNS server
|
||||
<code>ns-aws.nono.io</code>, for it has both IPv4 and IPv6 addresses:</p>
|
||||
<pre>
|
||||
dig @ns-aws.nono.io txt . +short # sample reply "2607:fb90:464:ae1e:ed60:29c:884c:4b52"
|
||||
dig @ns-aws.nono.io txt . +short -4 # forces IPv4 lookup; sample reply "172.58.35.231"
|
||||
dig @ns-aws.nono.io txt . +short -6 # forces IPv6 lookup; sample reply "2607:fb90:464:ae1e:ed60:29c:884c:4b52"</pre>
|
||||
dig @ns-aws.nono.io txt ip.sslip.io +short # sample reply "2607:fb90:464:ae1e:ed60:29c:884c:4b52"
|
||||
dig @ns-aws.nono.io txt ip.sslip.io +short -4 # forces IPv4 lookup; sample reply "172.58.35.231"
|
||||
dig @ns-aws.nono.io txt ip.sslip.io +short -6 # forces IPv6 lookup; sample reply "2607:fb90:464:ae1e:ed60:29c:884c:4b52"</pre>
|
||||
<div class="alert alert-warning" role="alert">
|
||||
When querying for your IP address, always <b>include the sslip.io nameserver</b> (e.g. <i>@ns-aws.nono.io</i>).
|
||||
If omitted, you won't get your IP address; instead, you'll get the IP address of your upstream nameserver.
|
||||
</div>
|
||||
<p>This feature was inspired by Google's DNS lookup, i.e. <code>dig txt o-o.myaddr.l.google.com @8.8.8.8
|
||||
+short</code>. There are also popular HTTP-based services for determining your public IP address:</p>
|
||||
<ul>
|
||||
@@ -227,6 +233,17 @@ dig @ns-aws.nono.io txt . +short -6 # forces IPv6 lookup; sample reply "2607:fb9
|
||||
"https://icanhazip.com/">https://icanhazip.com/</a> requires 8692 bytes spread out over 34 packets—over 14 times
|
||||
as much! Admittedly bandwidth usage is a bigger concern for the one hosting the service than the one using the
|
||||
service.</p>
|
||||
<h4 id="version">Determining The Server Version of Software</h4>You can determine the server version of the
|
||||
sslip.io software by querying the TXT record of <code>version.sslip.io</code>:
|
||||
<pre>
|
||||
dig @ns-aws.nono.io txt version.sslip.io +short
|
||||
"2.2.1"
|
||||
"2021/10/06-05:17:18-0700"
|
||||
"7bef649"
|
||||
</pre>
|
||||
<p>The first number, ("2.2.1"), is the version of the sslip.io DNS software, and is most relevant. The other two
|
||||
numbers are the date compiled and the most recent git hash, but those values can differ across servers due to the
|
||||
manner in which the software is deployed.</p>
|
||||
<h3 id="related">Related Services</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
Reference in New Issue
Block a user