Finding domain details with bash
Shellcheck reports quite a few issues you might want to correct:
shellcheck -f gcc  197939.sh
197939.sh:2:5: warning: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate. [SC2124]
197939.sh:5:24: note: Backslash is literal in &quot;\.&quot;. Prefer explicit escaping: &quot;\\.&quot;. [SC1117]
197939.sh:5:36: note: Backslash is literal in &quot;\.&quot;. Prefer explicit escaping: &quot;\\.&quot;. [SC1117]
197939.sh:5:48: note: Backslash is literal in &quot;\.&quot;. Prefer explicit escaping: &quot;\\.&quot;. [SC1117]
197939.sh:8:14: error: Double quote array expansions to avoid re-splitting elements. [SC2068]
197939.sh:10:17: note: Use $(..) instead of legacy `..`. [SC2006]
197939.sh:10:22: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:10:25: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:13:38: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:14:28: note: Use $(..) instead of legacy `..`. [SC2006]
197939.sh:14:38: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:15:38: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:16:22: note: Use $(..) instead of legacy `..`. [SC2006]
197939.sh:16:29: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:16:38: note: egrep is non-standard and deprecated. Use grep -E instead. [SC2196]
197939.sh:17:39: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:25:13: note: Use $(..) instead of legacy `..`. [SC2006]
197939.sh:25:19: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:26:11: note: Use $(..) instead of legacy `..`. [SC2006]
197939.sh:26:33: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:27:26: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:28:16: note: Use $(..) instead of legacy `..`. [SC2006]
197939.sh:28:38: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:29:27: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:32:10: error: Double quote array expansions to avoid re-splitting elements. [SC2068]
197939.sh:34:27: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:35:14: note: Use $(..) instead of legacy `..`. [SC2006]
197939.sh:35:33: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:47:11: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:48:23: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:49:9: note: Use $(..) instead of legacy `..`. [SC2006]
197939.sh:49:19: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:54:13: note: Use $(..) instead of legacy `..`. [SC2006]
197939.sh:54:22: note: Double quote to prevent globbing and word splitting. [SC2086]
197939.sh:55:26: note: Double quote to prevent globbing and word splitting. [SC2086]

Additionally, I recommend making regexp, nameserver, IPADD, ServerName and DATA local within check() (and giving most of them better names, or inlining the single-use ones), and making Pinging, IPADD and ServerName local within check2():
check ()
{
    local regexp='^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$'
    local nameserver=('@ns1.ournameserver.com' '@ns2.ournameserver.com' '@ns3.ournameserver.com')

    for j in &quot;${nameserver[@]}&quot;
    do
        local IPADD
        IPADD=$(dig &quot;$j&quot; &quot;$i&quot; +noall +answer | grep &quot;A&quot; | awk '{print $5}')
        if [[ $IPADD =~ $regexp ]]
        then
            echo &quot;IP Address = $IPADD&quot;
            echo &quot;ServerName = $(nslookup &quot;$IPADD&quot; | grep -o -P '(?&lt;=\=).*(?=.)')&quot;
            echo &quot;Data Center = $(whois &quot;$IPADD&quot; | grep -E 'org-name|OrgName' | awk '{print $2.$3}')&quot;
            break
        fi
    done
}

check2 ()
{
    local Pinging
    Pinging=$(ping &quot;$i&quot; -c 1 | grep 'from' | cut -d$' ' -f4-5| tr '\(|\)' ' ')
    echo &quot;IP Address = $(awk '{print $2}' &lt;&lt;&lt;&quot;$Pinging&quot;)&quot;
    echo &quot;Server Name = $(awk '{print $1}' &lt;&lt;&lt;&quot;$Pinging&quot;)&quot;
}

Prefer to pass &quot;$i&quot; as an argument to check(), rather than communicating via global variables.  And communicate the $IPADD from the last successful nameserver by other means.
Instead of extracting substrings using grep, then testing them with [[ =~ ]], simply use grep -q for the test.
Improved code
There's still plenty left to work on (for example, repeated whois invocations).
#!/bin/bash

check ()
{
    local regexp='^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$'
    local nameserver=('ns1.ournameserver.com' 'ns2.ournameserver.com' 'ns3.ournameserver.com')

    for j in &quot;${nameserver[@]}&quot;
    do
        local IPADD
        IPADD=$(dig &quot;@$j&quot; &quot;$1&quot; +noall +answer | grep -w 'A' | awk '$4==&quot;A&quot; {print $5}')
        if [[ $IPADD =~ $regexp ]]
        then
            echo &quot;IP Address = $IPADD&quot;
            echo &quot;ServerName = $(nslookup &quot;$IPADD&quot; | grep -o -P '(?&lt;=\=).*(?=.)')&quot;
            echo &quot;Data Center = $(whois &quot;$IPADD&quot; | grep -E 'org-name|OrgName' | awk '{print $2.$3}')&quot;
            return 0
        fi
    done
    return 1
}

check2 ()
{
    local Pinging
    Pinging=$(ping &quot;$1&quot; -c 1 | grep 'from' | cut -d$' ' -f4-5| tr '()' ' ')
    echo &quot;IP Address = $(awk '{print $2}' &lt;&lt;&lt;&quot;$Pinging&quot;)&quot;
    echo &quot;Server Name = $(awk '{print $1}' &lt;&lt;&lt;&quot;$Pinging&quot;)&quot;
}

for i in &quot;$@&quot;
do
    echo &quot;Domain Name = $i&quot;
    if nslookup -type=ns &quot;$i&quot; | grep -q 'nameserver.*cloudflare.com'
    then
        check &quot;$i&quot; || echo &quot;This Domain does not belong to this server.&quot;
    else
        check2 &quot;$i&quot;
    fi

    whois &quot;$i&quot; | grep &quot;Registrant Name&quot;
    nslookup -type=ns &quot;$i&quot; | grep nameserver | awk '{print $2,$3,$4}'
    if curl -sL &quot;http://$i&quot; | grep -q '&lt;title&gt;.*Account.*Suspended'
    then
        echo &quot;Status = Account Suspended&quot;
    else
        echo &quot;Status = $(curl -I &quot;$i&quot; 2&gt;/dev/null | head -n 1 | cut -d$' ' -f2-3)&quot; 
    fi
    printf '%*s\n' 100 | tr ' ' '#'
done