From b40dfc33820c8663edc7ed0060840f0862bf09ed Mon Sep 17 00:00:00 2001 From: David Kebler Date: Mon, 29 Apr 2024 13:01:28 -0700 Subject: [PATCH] add curl based DNS lookup --- load/01-basic | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/load/01-basic b/load/01-basic index ec13ffd..348d79e 100644 --- a/load/01-basic +++ b/load/01-basic @@ -55,3 +55,14 @@ gedit() { ${GEDITOR:-xed} $@; } unlocku () ( faillock --user $1 --reset ) rsynchg() { rsync --help | grep "\-$1"; } + + +gip () { + if which jqx &> /dev/null; then + curl -s "https://dns.google/resolve?name=$1" | jq -r '.Answer[] | .data' + return 0 + else + echo install jq to use this function + return 1 + fi +} \ No newline at end of file