knightly

Monthly Archives: July 2008

Highjacked name server or not?

Yesterday was a weird day. Nothing seemed to go as it should have. My coworker Marius noticed that one of my domains was not responding anymore. We tried to ping it. But forgot that our admins block outbound ICMP packages. At least we could see the domain resolved to the correct IP address.

So we did a lookup on the domain. No weird things here. Then we decided to ping the name servers to see if they were responding. They were. But there was something strange. The domain in question runs on two name servers. namely ns1.cker.sc and ns2.cker.sc. ns1 was responding correctly. ns2 however was responding with a totally different and unknown IP address. This is weird. The normal settings would be:

ns1.cker.sc ( 208.69.125.116 )
ns2.cker.sc ( 208.69.125.117 )

ns2 however responded with 208.69.34.132. The whois database at ripe.net told us it was in the IANA pool of addresses. But we couldn’t find a whois tool there. So i opened up a browser to go directly to this IP address. This showed a temporary OpenDNS page. Off to domaintools.com to do a reverse lookup on this IP.

This revealed one domain matching this IP address. Some weird long domain name. At first i was thinking somebody highjacked my DNS server or maybe some DNS cache poisoning. But after looking closely i noticed the domain was actually readable. The domain returned was : Caffefiaschetteriaitaliana.com. A google search returned some italian cafe with almost the same domain. fiaschetteriaitaliana.it.

So we decided to do a whois query on the .com domain. This revealed some email addresses with similar domains. And technical contacts from aruba.it. By now we had the feeling somebody made a configuration error. So i decided to send an email to all the addresses matching this domain including OpenDNS. And after about an hour the nameserver was responding correctly again. So they either corrected a mistake or it was just a temporary fluke. I never got a reply from any of the addresses i wrote to.

Although i’m happy the nameservers are responding properly again. I’m still stuck with the question. What the hell happened here? The most logical scenario for me is still a configuration error.

UPDATE: 12-08-2008

After some digging. I found out that the ip address “208.69.34.132″ actually belongs to opendns.com. When a non existing sub -/ domain is quieried. This ip is returned. It’s just a way to make money from ads. the network i was connected to at that moment uses an opendns.com DNS cache server. That explains that part.

PEAR install weirdness

This morning i wanted to play around with firePHP a bit. And wanted to install the PEAR package. When i found out i didn’t have PEAR running on my local (win32 xp) box. So off to the pear install. The first thing i notice was that PEAR now is packaged as a nice PHAR file (PHP 5.2.6) . So i hoped the install process would be smoother then normally. This was not the case. First thing i did was run the go-pear.bat file. Which resulted in an error.

phar “[path]go-pear.phar” does not have a signature
Warning: require_once(phar://go-pear.phar/index.php): failed to open stream: pha
r “[path]go-pear.phar” does not have a signature in [path]\PEAR\go-pear.phar on line 1236

Fatal error: require_once(): Failed opening required ‘phar://go-pear.phar/index.
php’ (include_path=’.;[path][path]\PEAR’) in [path]\PEAR\go-pear.phar on line 1236

Ok. So that didn’t work out like i wanted. I checked the go-pear.bat file. And copied the command to windows command line. This resulted in the same error. So i thought. Let’s try this from the PEAR directory. cd PEAR and let’s try that again.

php.exe -d phar.require_hash=0 go-pear.phar

Now the PEAR install runs fine.

For more information about PEAR, see:

http://pear.php.net/faq.php

http://pear.php.net/manual/

Thanks for using go-pear!

Update *

Although this solution seems to have resolved the problem for me. Cal Evans has a good post how to resolve this issue as well. My workaround didn’t solve the problem for Cal but his did for me. So here’s the link

Help a MySQL support engineer.

Today on planet-php.net there are some posts [1] [2] about Andrii Nikitin a MySQL support engineer based in Ukraine. Andrii’s (2,5 year old) son Ivan is in need of a bone marrow transplant. The cost for this operation is somewhere bewteen $150.000 and $250.000. Which is a lot of money. So he asked the MySQL community for help. Although i don’t know the guy. I do use MySQL regularly. And i feel for him and his family. So decided to add a donation. I’m in no way rich and just bought a new house. But i think every body should pitch in and help out this guy. And offer his son a fair chance at life.

Paypal:
http://tinyurl.com/6rxjsz
Or
by check payable to:

MySQL, Inc.
Mail to: MySQL, Inc.
Attn: Linda Dong
20450 Stevens Creek Blvd #350
Cupertino, CA 95014

or
US wire transfer:

MySQL Inc: 7396643001
SWIFT: NDEAUS3N

or
International wire transfer in any currency:
Bank: Nordea Bank
Bank address: Stockholm, Sweden
Bank account: 3259 17 03868
IBAN: SE27 3000 0000 0325 9170 3868
SWIFT: NDEASESS

Zend Framework BaseUrl Helper

Today i was working with the Zend Framework. And needed the baseUrl to set the correct path for stylesheets and external javascript files. To include stylesheets and javascript files there are methods available in ZF. In your controller you can set:

$this->view->headLink()->appendStylesheet('/css/tester.css');

In your view or layout you can then call

$this->headLink();

This works great. But the current development structure lacks some good rewrite rules. And having the baseUrl is always a good thing. So i did some searching on Google. To figure out if somebody already has a solution for this problem. After a few minutes i found a post written by Yusak Setiawan from zendindonesia (which is defaced by the way) explaining how to add a placeholder in the bootstrap file. Now this is a good solution. But i like to keep my bootstrap file as clean as possible. So i decided to add a Helper that would do the trick.

Create a file called ‘BaseUrl.php’ inside the Helper directory. And fill it with the following code.

class Zend_View_Helper_BaseUrl
{
    function baseUrl()
    {
        $base_url = substr($_SERVER['PHP_SELF'], 0, -9);
        return $base_url;
    }
}

After that it’s extremly easy to get the baseUrl in your views, layouts or controllers.

Inside the view or layout you can call:

$this->baseUrl();

And inside the controller you can call it like this.

$this->view->baseUrl();

Tudor Barbu wrote a great article on this subject.

Stop ACTA