Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pubdns
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arsen Stasic
pubdns
Commits
c69dc0d2
Commit
c69dc0d2
authored
8 years ago
by
Arsen Stasic
Browse files
Options
Downloads
Patches
Plain Diff
initial commit
parents
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pubdns.sh
+64
-0
64 additions, 0 deletions
pubdns.sh
with
64 additions
and
0 deletions
pubdns.sh
0 → 100755
+
64
−
0
View file @
c69dc0d2
#!/bin/sh
# query well known public dns resolvers
# and my own dns resolvers
#
# 2016-05-15 arsen.stasic@univie.ac.at initial setup
# 2016-06-08 adding my own dns resolvers
# 2016-06-27 adding some comments before pushing to git ;-)
#
#dyndns unbound: https://ripe72.ripe.net/archives/video/231/ 6:40
#ipv4 for dns-oarc is not working
#184.105.193.73#bind.odvr.dns-oarc.net
#184.105.193.74#unbound.odvr.dns-oarc.net
# define max length for pretty-printing output
MAXLEN
=
'resolver1.dyndnsinternetguide.com '
# list of public dns resolvers
PUBRESOLVERS
=
'
8.8.8.8[google-public-dns-a.google.com]
216.146.35.35[resolver1.dyndnsinternetguide.com]
208.67.222.222[resolver1.opendns.com]
156.154.71.1[rdns2.ultradns.net]
4.2.2.2[b.resolvers.Level3.net]
2620:ff:c000:0:1:0:64:20[bind.odvr.dns-oarc.net]
2620:ff:c000:0:1:0:64:21[unbound.odvr.dns-oarc.net]
37.235.1.177[resolver2.freedns.zone]
64.6.64.6[recpubns1.nstld.net]'
# my own dns resolvers
MYRESOLVERS
=
'
127.0.0.1[bind-localhost]
127.0.0.2[unbound-localhost]
127.0.0.3[knot-resolver-localhost]
127.0.0.4[pdns-recursor-localhost]
'
HOSTNAME
=
$(
hostname
)
MYPC
=
'pcas'
RES
=
''
# test if I'm unsing my own PC, because I multiple resolvers installed
if
[
"
$HOSTNAME
"
=
"
$MYPC
"
]
;
then
RES
=
"
$PUBRESOLVERS
$MYRESOLVERS
"
else
RES
=
$PUBRESOLVERS
fi
# test if dig is available
command
-v
dig
>
/dev/null 2>&1
||
{
echo
"dig is required but not installed. Aborting."
>
&2
;
exit
1
;
}
for
i
in
$RES
;
do
# echo "\t$i"
RES
=
$(
echo
$i
|
awk
-F
'['
'{ print $1 }'
)
NAM
=
$(
echo
$i
|
awk
-F
'['
'{ print $2 }'
)
LEN
=
${#
NAM
}
;
# echo "length of $RES: $LEN";
DIF
=
$(
expr
${#
MAXLEN
}
-
${
LEN
}
)
;
echo
-n
"
$(
tput setaf 3
)
${
NAM
}
$(
tput sgr0
)
"
;
printf
'.%.0s'
$(
seq
1
$DIF
)
;
#echo $RES
dig @
$RES
$*
done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment