Re: gethostbyname () uses old DNS server
| From: | itoctopus | Date: | Tue, 27 Mar 2007 12:42:28 +0000 |
| Subject: | Re: gethostbyname () uses old DNS server | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-251446@lists.php.net to get a copy of this message | ||
gethostbyname uses the local DNS cache, could that be the problem?
--
itoctopus - http://www.itoctopus.com
"Kent Tong" <kent@cpttm.org.mo> wrote in message
news:loom.20070326T110351-437@post.gmane.org...
> Hi,
>
> We have moved our DNS server from one IP to another. But on a Linux
> server, the PHP programs keep using the old DNS server IP. For
> example, for a simple php file:
>
> <? echo gethostbyname ("smtp.cpttm"); ?>
>
> When it is run, it tries to lookup smtp.cpttm using the old DNS
> server (I know it using tcpdump). The new DNS server is specified in
> /etc/resolv.conf. If I issue "ping smtp.cpttm" in a command prompt,
> then tcpdump shows that it is accessing the new DNS server.
>
> Any idea? Thanks.