random technical thoughts from the Nominet technical team

dnsjava oddity

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
Posted by ray on Nov 28th, 2007

I’m currently writing a Java library to implement client-side ENUM lookups [RFC3761].

The standard class libraries don’t provide access to NAPTR records, so I’m using the dnsjava library to perform the actual DNS lookups.

I was puzzled to find that the result of calling (String)NAPTRRecord.getRegexp() on any RR containing backslash escaped strings (i.e. !^\+441865332...) ended up with the backslashes apparently doubled-up, i.e I’d see !^\\+441865332... in the result of the function.

At first I thought that it was the actual zone data that had the extra backslashes in it, and this was further confused by the fact that dig’s output also showed two backslashes. However tcpdump showed that the wire format of the DNS responses was in fact correct and only contained single backslashes.

It turns out that dnsjava intentionally stores and returns all string fields in escaped format. If the data itself contains a backslash then that backslash in turn is escaped

If you want to use dnsjava to output a zone file for loading into your favourite name server that’s very useful, since name servers typically expect to read escaped data from their zone files. This is why dig works the way it does - the output from dig is a legal zone file.

However if you actually want to use these strings as data in your own code, make sure you unescape the values yourself!

Avoiding DNS delays with EventMachine::connect

1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 4 out of 5)
Loading ... Loading ...
Posted by alexd on Nov 21st, 2007

A concern with EventMachine has been potential blocking in the EventMachine::connect call, e.g. :

EventMachine::connect("dns-that-takes-ages.com", port, MyClass)

This call can block for a very long time, which is against the spirit of EventMachine. Fortunately, this problem can be solved using Dnsruby. A certain amount of boilerplate code is required here, which could be wrapped up in a new "EventMachine::connect_nonblock" call :

#boilerplate code
require 'Dnsruby'
require 'eventmachine'
res = Dnsruby::Resolver.new # use system defaults
Dnsruby::Resolver.use_eventmachine
Dnsruby::Resolver.start_eventmachine_loop(false)

#interesting code
#assumes EventMachine::run has been called
name = "dns_that_takes_ages.com"
df = res.send_async(Message.new(name))
df.callback {|msg|
  EM.connect(msg.answer[0], 8289, MyClass) {}
}
df.errback {|msg, err|
  print "Sorry - can't resolve #{name}. Error = #{err}n"
}

Now the call is non-blocking. If the DNS lookup succeeds, then the EM::connect call will continue as before. If the name can’t be resolved, then a different action is taken.

Dnsruby version 1.0

1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 4 out of 5)
Loading ... Loading ...
Posted by alexd on Nov 16th, 2007

I’ve just released version 1.0 of dnsruby. You can find it here or install it by running :

gem install Dnsruby –test

Dnsruby now does pretty much everything you would expect from a stub resolver library - with the exception of DNSSEC (which will come with dnsruby version 2.0). However, you can still do signed zone tranfers and signed dynamic updates with this release. EDNS(0) is also fully supported. It can use EventMachine for its I/O, or an inbuilt pure Ruby event loop.

For more information, check out the RDoc and have a rummage through the demo folder in the distribution.

Enjoy!

DBCA and large filesystems

1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 1.67 out of 5)
Loading ... Loading ...
Posted by jason on Nov 9th, 2007

I never used to like dbca for creating a database, I much prefered the more hardcore (and more configurable) method of creating a script to create the database, and indeed all the production databases created here at nominet have been scripted rather than gui’d into existence. However I have found myself using dbca more and more, particularly since we upgraded to Oracle 10.2 a while back, dbca is much more useable, I used to find this java painfully slow, but 10.2 performs much faster. The reason I’ve been using it more is that our developers want empty databases that they then run the auto schema building tools on to give them the schemas to develop against but without data. I find dbca very useful for creating this type of database.
However it seems like dbca (10.2.0.3) has a limit on the size of filesystem that it can understand and throws an error when attempting to install onto a filesystem that is larger than it understands:

dbca file overflow

There was actually around 16TB of free space available rather than the -1 the gui is suggesting. Thankfully clicking ignore allowed the installation to proceed successfully.

RFC2845 TSIG clarification

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 3 out of 5)
Loading ... Loading ...
Posted by alexd on Nov 2nd, 2007

I’ve been implementing a variety of RFCs recently. Normally I find them to be quite precise in their definitions - as you’d hope! So I was surprised when I found an (admittedly very small) ambiguity in RFC2845. Continue Reading »

PGP Desktop broken on Leopard

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 3 out of 5)
Loading ... Loading ...
Posted by jason on Nov 2nd, 2007

We use PGP a lot here at Nominet, and I have been using PGP Desktop 9.6.3 on my Mac for quite some time. Unfortunately after upgrading to Leopard PGP Desktop is no longer working. I believe an update is due sometime in November, though this is in fact the beta program for PGP Desktop 9.7. Leopard has been available to developers for many, many months (with the iPhone delaying things as well) so I can’t really comprehend how they failed to test the product with Leopard.

Instead of waiting for this update I decided to look at GnuPGP, you can download and compile this very straightforwardly, though watch out if you see the following when compiling:

/usr/lib/libSystem.dylib unknown flags (type) of section 9 (__TEXT,__dof_plockstat)

What you need to do is make sure you have installed the Xcode tools from the Leopard DVD, doing an upgrade from Tiger does not upgrade Xcode!

You can even pick up a dmg file from sourceforge.

Lotus Notes 8 - Fonts unreadable on Gutsy

1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 3.67 out of 5)
Loading ... Loading ...
Posted by andyh on Nov 1st, 2007

I run Ubuntu 64-bit and have never managed to install lotus notes 8 client - the install always failed. Having just upgraded to Gutsy I thought I would give it another try. I had to run the installer a few times and install some 32-bit libs but it worked and there was notes 8 in the menu. Great. But then I logged in and the fonts were unreadable. You can easily change the default fonts and by changing them to Arial I did get something readable - with a magnifying glass! Then I found a post (sorry - lost the link) that said add Display_font_adjustment=5 to notes.ini

This worked (I ended up turning this down to a value of 0.5 and text was still very readable) for most windows but the login, spell check and error message boxes were all still the original unreadable font. Turns out that the default font is Luxi which is available in the “ttf-xfree86-nonfree” package.

Now at least all notes windows are readable.

Recent Posts

Highest Rated

Categories

Archives

Meta: