Then how to be? Out of 100 ip 6-8 ips give out 401 and the rest are not working at all
Wait, why are you trying to connect to 100 IP addresses? Did you get IP addresses of random Bitcoin nodes and try to query them? That doesn't work. Especially since they most likely do not expose their RPC interface to the internet. That would be highly insecure.
Do you even have your own Bitcoin node?