From 89fde516ca83035382a2b51faf202a9e93af2f92 Mon Sep 17 00:00:00 2001 From: Michael Heidelberger Date: Thu, 19 Apr 2018 11:27:13 -0500 Subject: [PATCH] Fixed issue with direct IP looking without an MX address throwing up errors --- ip-api.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ip-api.py b/ip-api.py index 452471f..17d98bb 100644 --- a/ip-api.py +++ b/ip-api.py @@ -51,8 +51,7 @@ if __name__ == "__main__": parser.add_argument("host", help="hostname to lookip") args = parser.parse_args() # If the arg is an IP address go straight to API - if re.fullmatch(args.host, - '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'): - query_api(args.host) + if re.search('[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}', args.host): + query_api([args.host]) else: findMX(args.host)