V
V
VN2022-01-10 23:28:53
bash
VN, 2022-01-10 23:28:53

How to remove dot after domain?

You only need to get the domain and its ip. I get:

dig google.com +noall +answer | cut -f 1,6
google.com.     216.58.209.206


output:

google.com. 216.58.209.206

remove point:

dig google.com +noall +answer | cut -f 1 | sed -e 's/\.$//'


Stuck on how to display everything with one command domain without dot and ip

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
galaxy, 2022-01-10
@kavabangaungava

Well, developing your idea:

dig google.com +noall +answer | cut -f 1,6 | sed -e 's/\.\t/\t/'

S
Saboteur, 2022-01-11
@saboteur_kiev

dig google.com +noall +answer|awk '{print $5" "substr($1,1,length($1)-1)}'

A
Alexander Karabanov, 2022-01-11
@karabanov

host -t A google.com | cut -d ' ' -f 1,4

google.com 142.251.1.102
google.com 142.251.1.138
google.com 142.251.1.139
google.com 142.251.1.101
google.com 142.251.1.100
google.com 142.251.1.113

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question