1

I got the error message "No whois server is known for this kind of object." When I had my script run.

#!/bin/bash

domain_list="input.txt"
while read line
do
        name=$line
        echo $name
        whois $name
        sleep 2
done < input.txt

But if I check each line of the input.txt individually as follow it worked !! whois exmaple.com

  • UPDATE ANSWER
while IFS=$' \t\r\n' read -r line
cacalun12
  • 55
  • 5
  • 3
    Most likely `input.txt` contains DOS `CRLF` line endings rather than 'nix `LF`, so the `read` command reads the `CR` character as well and it creates invalid domain names. Try `while IFS=$' \t\r\n' read -r line` – Léa Gris Feb 09 '22 at 07:34
  • 1
    To verify what LéaGris suspected, have a look at `xxd input.txt`. – user1934428 Feb 09 '22 at 07:56

0 Answers0