Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2017-05-27, 00:30:21

Author Topic: wget name resolution error  (Read 309 times)

0 Members and 1 Guest are viewing this topic.

Offline jtaco263

  • Valuable Member
  • *
  • Posts: 148
  • Karma: +0/-0
    • View Profile
wget name resolution error
« on: 2017-05-13, 07:52:03 »
hey im trying to make a curl request to cloudflare but i tried from terminal}
wget google.com
and this is the result:
Code: [Select]
[root@sv1 ~]# wget google.com
--2017-05-13 01:54:05--  http://google.com/
Resolving google.com... failed: Temporary failure in name resolution.
wget: unable to resolve host address `google.com'

my sysinfo:

Code: [Select]
A. Control Panel:
   - Kloxo-MR: 7.0.0.c-2017042302
   - Web: hiawatha-10.5.0-f.2.mr.el6.x86_64
   - PHP: php54s-5.4.45-1.ius.centos6 (fpm mode)
B. Plateform:
   - OS: CentOS release 6.9 (Final) x86_64
   - Hostname: sv1.dattasolutions.com.mx
C. Services:
   1. MySQL: MariaDB-server-10.0.30-1.el6.x86_64
   2. PHP:
      - Installed:
        - Branch: php54-cli-5.4.45-1.ius.centos6.x86_64
        - Multiple:
          * php53m-5.3.29-1.ius.centos6
          * php54m-5.4.45-1.ius.centos6
          * php55m-5.5.38-1.ius.centos6
      - Used: --PHP Branch--
      - Multiple: enable
   3. Web Used: apache
     - Hiawatha: hiawatha-10.5.0-f.2.mr.el6.x86_64
     - Lighttpd: lighttpd-1.4.45-1.el6.x86_64
     - Nginx: nginx-1.12.0-1.el6.ngx.x86_64
     - Apache: httpd-2.2.31-1.mr.el6.x86_64
       - PHP Type: php-fpm_worker
       - Secondary PHP: on
   4. WebCache: none
     - ATS: --uninstalled--
     - Squid: --uninstalled--
     - Varnish: --uninstalled--
   5. Dns: bind
     - Bind: bind-9.9.9-1.mr.el6.x86_64
     - DJBDns: djbdns-1.05-17.4.mr.el6.x86_64
     - NSD: nsd-4.1.14-1.el6.x86_64
     - PowerDNS: pdns-4.0.3-1.el6.MIND.x86_64
     - Yadifa: yadifa-2.2.3-1.mr.el6.x86_64
   6. Mail: qmail-toaster-1.03-1.3.56.mr.el6.x86_64
      - pop3/imap4: none
      - smtp: none
      - spam: bogofilter-1.2.4-1.el6.x86_64
   7. FTP: pure-ftpd
      - pure-ftpd: pure-ftpd-1.0.37-1.mr.el6.x86_64
   8. Stats: awstats
      - awstats: kloxomr-stats-awstats-7.5-1.mr.noarch
D. Memory:
             total       used       free     shared    buffers     cached
Mem:          6144        532       5611          4          0        237
-/+ buffers/cache:        295       5848
Swap:         6144          0       6144
E. Disk Space:
Filesystem         Size  Used Avail Use% Mounted on
/dev/ploop29144p1  148G   11G  130G   8% /


*** Process Time: 00:00:00:47.47104 (dd:hh:mm:ss:xxxxxx) ***

* Note: run 'sh /script/sysinfo -y' if you want run 'fix-service-list' also
        (importance after Kloxo-MR update)

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 14,487
  • Karma: +105/-8
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: wget name resolution error
« Reply #1 on: 2017-05-13, 08:06:12 »
Inform here 'cat /etc/resolv.conf; traceroute google.com'
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline jtaco263

  • Valuable Member
  • *
  • Posts: 148
  • Karma: +0/-0
    • View Profile
Re: wget name resolution error
« Reply #2 on: 2017-05-13, 08:08:06 »
Code: [Select]
[root@sv1 ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search dattasolutions.com.mx


# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
Code: [Select]
[root@sv1 ~]# traceroute google.com
-bash: traceroute: command not found
[root@sv1 ~]#

Offline jtaco263

  • Valuable Member
  • *
  • Posts: 148
  • Karma: +0/-0
    • View Profile
Re: wget name resolution error
« Reply #3 on: 2017-05-13, 08:10:11 »
literal with every domain throws the same error

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 14,487
  • Karma: +105/-8
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: wget name resolution error
« Reply #4 on: 2017-05-13, 08:15:00 »
Try change content of /etc/resolv.conf to:
Code: [Select]
nameserver 8.8.8.8
nameserver 8.8.4.4
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline jtaco263

  • Valuable Member
  • *
  • Posts: 148
  • Karma: +0/-0
    • View Profile
Re: wget name resolution error
« Reply #5 on: 2017-05-13, 08:20:46 »
that worked but its gonna work with the sites?

in curl i have this error:

Couldn't resolve host 'api.cloudflare.com'

but i did ping and it worked this isd the code im using
Code: [Select]
function puto(){
$url = 'https://api.cloudflare.com/client/v4/zones/fffcc847cd955d4d7e8afac10ee59b84/dns_records/638bd4ca58aea88a232b0658ada71da3';
$dato =  array('type' => 'A','name' => 'remote.dattasolutions.com.mx','content' => get_ip());
$request = json_encode($dato);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS,$request);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','X-Auth-Email: xxxx@gmail.com','X-Auth-Key: 7ffffgghhgga77e428df2d834ea3f1147e346572ad'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$response = curl_exec($ch);

   if (curl_errno($ch))
    {
    print curl_error($ch);
    exit();
   
}else{
echo 'yes';
echo '<br>';
curl_close($ch);
echo $response;
}
}

Offline jtaco263

  • Valuable Member
  • *
  • Posts: 148
  • Karma: +0/-0
    • View Profile
Re: wget name resolution error
« Reply #6 on: 2017-05-13, 08:22:49 »
and its weird because i have a desktop app which uses curl to upload images to my server and its working

Offline jtaco263

  • Valuable Member
  • *
  • Posts: 148
  • Karma: +0/-0
    • View Profile
Re: wget name resolution error
« Reply #7 on: 2017-05-13, 08:28:18 »
i did ping to google and found out this:
Code: [Select]
64 bytes from iad23s58-in-f14.1e100.net (172.217.7.238): icmp_seq=19 ttl=53 time=85.1 ms
what that means

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 14,487
  • Karma: +105/-8
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: wget name resolution error
« Reply #8 on: 2017-05-13, 08:35:35 »
i did ping to google and found out this:
Code: [Select]
64 bytes from iad23s58-in-f14.1e100.net (172.217.7.238): icmp_seq=19 ttl=53 time=85.1 ms
what that means
Google use multiple IP (redundance -?) for their website. It's normal.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline jtaco263

  • Valuable Member
  • *
  • Posts: 148
  • Karma: +0/-0
    • View Profile
Re: wget name resolution error
« Reply #9 on: 2017-05-13, 08:36:51 »
what about curl? is not making connections

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 14,487
  • Karma: +105/-8
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: wget name resolution error
« Reply #10 on: 2017-05-13, 08:59:09 »
Try add:
Code: [Select]
error_reporting(E_ALL);
ini_set('display_errors', 1);
under '<?php' in your php file.

In my test, no declare for get_ip() function.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 14,487
  • Karma: +105/-8
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: wget name resolution error
« Reply #11 on: 2017-05-13, 09:01:24 »
So, I change the code to:
Code: [Select]
function puto(){
$url = 'https://api.cloudflare.com/client/v4/zones/fffcc847cd955d4d7e8afac10ee59b84/dns_records/638bd4ca58aea88a232b0658ada71da3';
$dato =  array('type' => 'A','name' => 'remote.dattasolutions.com.mx','content' => gethostbyname('remote.dattasolutions.com.mx'));

$request = json_encode($dato);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS,$request);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','X-Auth-Email: xxxx@gmail.com','X-Auth-Key: 7ffffgghhgga77e428df2d834ea3f1147e346572ad'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$response = curl_exec($ch);

if (curl_errno($ch)) {
print curl_error($ch);
exit();
} else{
echo 'yes';
echo '<br>';
curl_close($ch);
echo $response;
}
}
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline jtaco263

  • Valuable Member
  • *
  • Posts: 148
  • Karma: +0/-0
    • View Profile
Re: wget name resolution error
« Reply #12 on: 2017-05-13, 09:03:49 »
Couldn't resolve host 'api.cloudflare.com'

Offline jtaco263

  • Valuable Member
  • *
  • Posts: 148
  • Karma: +0/-0
    • View Profile
Re: wget name resolution error
« Reply #13 on: 2017-05-13, 09:05:23 »
this is the answer
Couldn't resolve host 'api.cloudflare.com'

same with google.com

curl is not making connections with any website

Offline jtaco263

  • Valuable Member
  • *
  • Posts: 148
  • Karma: +0/-0
    • View Profile
Re: wget name resolution error
« Reply #14 on: 2017-05-13, 09:24:57 »
the php curl is not working properly
it not resolve hosts how do i solve this?

 


Top 4 Global Search Engines:    Google    Bing    Baidu    Yahoo
Click Here

Page created in 0.047 seconds with 18 queries.

web stats analysis