Welcome! Log In Create A New Profile

Advanced

Re: nginx reload fails with [emerg] host not found in upstream

December 07, 2012 01:22AM
maybe this one's better:

12/07 06:19[root@proxy2-prod-ue1 ~]# cat gethostbyname.c
#include <stdio.h>
#include <netdb.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>

int main(int argc, char *argv[])
{
if (argc < 2) {
fprintf(stderr, "usage: %s hostname\n", argv[0]);
return 1;
}

// skip 0 because that is the program name
for (int i = 1; i < argc; ++i) {

struct hostent *lh = gethostbyname( argv[i] );

if (lh) {
struct in_addr **addr_list;
addr_list = (struct in_addr **) lh->h_addr_list;

printf("%-14s %s\n",
inet_ntoa( *addr_list[0] ),
lh->h_name
);
}
else {
herror("gethostbyname");
}
}

return 0;
}
12/07 06:20[root@proxy2-prod-ue1 ~]# gcc -std=c99 gethostbyname.c -o gethostbyname.bin
12/07 06:20[root@proxy2-prod-ue1 ~]# ./gethostbyname.bin webapp02c.prod.romeovoid.com
10.51.23.17 webapp02c.prod.romeovoid.com
12/07 06:21[root@proxy2-prod-ue1 ~]# ./gethostbyname.bin webapp06c.prod.romeovoid.com
10.195.76.80 webapp06c.prod.romeovoid.com


our DNS does work..
SubjectAuthorPosted

nginx reload fails with [emerg] host not found in upstream

groknautDecember 06, 2012 09:37PM

Re: nginx reload fails with [emerg] host not found in upstream

姚伟斌December 06, 2012 11:26PM

Re: nginx reload fails with [emerg] host not found in upstream

groknautDecember 07, 2012 12:33AM

Re: nginx reload fails with [emerg] host not found in upstream

groknautDecember 07, 2012 01:22AM

Re: nginx reload fails with [emerg] host not found in upstream

Ruslan ErmilovDecember 07, 2012 02:24AM

Re: nginx reload fails with [emerg] host not found in upstream

groknautDecember 07, 2012 05:11PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 115
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 184 on July 08, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready