Archive for May, 2010

Ubuntu Lucid Lynx and D-Link 2740B

Posted on May 22, 2010. Filed under: Uncategorized | Tags: , , , , , , , |

I recently got a D-Link 2740B router. The setup was quite easy and quick and everything seems to work fine… except that it takes now longer to open a web page or connect to an external host with ssh.

What happened ?

After a while, I found out that it seems that it is the hostname lookup which takes several seconds.
Doing

host http://www.google.com

in a shell, I get the following:

http://www.google.com is an alias for http://www.l.google.com.
http://www.l.google.com has address 72.14.221.104
http://www.l.google.com has address 72.14.221.99

and then after several seconds:

;; connection timed out; no servers could be reached

and then the same again after a another few seconds. In total, the host name lookup takes twenty seconds.

So I used tcpdump to check what’s going on:

19:46:33.188685 IP 192.168.1.3.36044 > 192.168.1.1.53: 38571+ A? http://www.google.com. (32)
19:46:33.240767 IP 192.168.1.1.53 > 192.168.1.3.36044: 38571 3/4/4 CNAME[|domain]
19:46:33.241626 IP 192.168.1.3.47654 > 192.168.1.1.53: 33883+ AAAA? http://www.l.google.com. (34)
[5 seconds pause]
19:46:38.241720 IP 192.168.1.3.47654 > 192.168.1.1.53: 33883+ AAAA? http://www.l.google.com. (34)
[5 seconds pause]
19:46:43.242194 IP 192.168.1.3.48845 > 192.168.1.1.53: 46916+ MX? http://www.l.google.com. (34)
[5 seconds pause]
19:46:48.242407 IP 192.168.1.3.48845 > 192.168.1.1.53: 46916+ MX? http://www.l.google.com. (34)

So after getting the initial response, host makes more lookups, an AAAA and an MX (mail exchanger) record lookup.
AAAA seem to be IPv6 address lookups (see e.g. http://en.wikipedia.org/wiki/IPv6). So I tried disabling IPv6
at boot time (putting the kernel parameter ipv6.disable=1 into the grub configuration as described at http://ubuntuforums.org/archive/index.php/t-1307259.html).

This did not solve the problem, host still seems to query AAAA records.

I tried editing /etc/resolv.conf manually and putting a DNS different from 192.168.1.1: for example the one which the 2740B queries itself when getting DNS record requests or Google’s public DNS (see http://code.google.com/speed/public-dns/). This seemed to speed up the name server lookup !

So it looks like the 2740B does not forward the AAAA record queries to the DNS provided by the internet service provider.

Also, an upgrade to the latest router firmware did not solve the problem.

After searching the web more, I found that there is a bug report on launchpad.net (https://bugs.launchpad.net/ubuntu/lucid/+source/eglibc/+bug/417757).
Quote from the bug report:

In Karmic, DNS lookups take a very long time with some routers, because glibc's DNS resolver tries to do IPv6 (AAAA) lookups even if there are no (non-loopback) IPv6 interfaces configured. Routers which do not repond to this cause the lookup to take 20 seconds (until the IPv6 query times out).

So the 2740B is probably not the only router showing this behaviour (although the Zyxel 660HW behaves better in this respect) and I’m looking forward to seeing this problem fixed on the Ubuntu side.

Advertisements
Read Full Post | Make a Comment ( 1 so far )

Disabling the splash screen during boot on Ubuntu Lucid Lynx

Posted on May 22, 2010. Filed under: Uncategorized | Tags: , , , , , , , |

I recently upgraded to Ubuntu Lucid Lynx. I get a nice blue (Kubuntu) splash screen during system startup. However, on one of my systems, the splash screen gets stuck from time to time (I once succesfully tried logging in over the network, so probably the system boots ok but the splash screen stays).

After searching around a bit, I replaced

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

by

GRUB_CMDLINE_LINUX_DEFAULT=""

in the file /etc/default/grub and then I ran

sudo update-grub

On the next reboot, instead of getting the splash screen, I got the detailed text messages about the progress of the boot process.

Read Full Post | Make a Comment ( None so far )

How to make the bookmarks become visible when opening a PDFBox generated file

Posted on May 19, 2010. Filed under: Uncategorized | Tags: , , , , |

I was wondering how to make the PDF reader show the bookmarks when opening a PDF file I generated with Apache’s PDFBox java library.

It turns out that the following did the trick for me:

PDDocument document = new PDDocument();
...
document.getDocumentCatalog().setPageMode(PDDocumentCatalog.PAGE_MODE_USE_OUTLINES);
....

Read Full Post | Make a Comment ( 1 so far )

Python + ROOT in Ubuntu Lucid Lynx

Posted on May 9, 2010. Filed under: Uncategorized | Tags: , , , |

I recently tried to get ROOT in Python (also known as PyROOT) working under the latest Ubuntu release (Lucid Lynx).

It took me a while until I figured out that I installing the Ubuntu package libroot-python5.18
was not sufficient but I also had to install libroot-python-dev in order to get it to work (i.e. do import ROOT from the python interpreter).
I also had to make sure that /usr/lib/root/5.18 was in my PYTHONPATH environment variable.

Read Full Post | Make a Comment ( None so far )

Liked it here?
Why not try sites on the blogroll...