Пример #1
0
def main(api_url, api_key, proxies):
  api = gclu_pdns.api.PDNSApi(api_url, api_key, verify_ssl=False, proxies=proxies)

  #j = api.get_domain_entries('google.org', ['a', 'mx'])
  #j = api.check_domains(['google.org', 'google.cn'])
  #j = api.check_domains(['google'], search_like=True)
  j = api.get_domains_by_a_record('173.194.70.139')
  #j = api.get_domains_by_a_record('127.0.0.1')

  j = gclu_pdns.api.json_pretty_print(j)
  print(j)
Пример #2
0
  if not options.records == '':
    records = options.records.split(',')

  if entries and len(domains) > 0:
    j = {}
    for d in domains:
      j.update(api.get_domain_entries(d, records))
  elif len(domains) > 0 or len(likedomains) > 0:
    like = False
    if len(likedomains) > 0:
      like = True

    domains += likedomains
    j = api.check_domains(domains, search_like=like)
  elif not record_a == '':
    j = api.get_domains_by_a_record(record_a)
  else:
    print('Fatal error: nothing to do O_o, check parameters!')
    print()
    parser.print_help()
    exit(1)

  j = gclu_pdns.api.json_pretty_print(j)
  print(j)

  sys.exit(1)
  try:
    main()
  except KeyboardInterrupt:
    sys.exit(1)
  except Exception as e: