Nov 022013
 

The DNS (the domain name system) is one of those Internet services that everybody uses; but most don’t even know it exists. That is partially a good thing – it is supposed to be invisible in the sense that it just works rather than causing problems. But everything – Internet Explorer, Firefox, Chrome, and anything that uses the network – uses the DNS.

But What Does It Do?

The DNS in a very simple sense is the way that applications such as Chrome (or any web browser) finds out what network address a name points to. When we visit a web page such as http://www.bbc.co.uk/, the web browser needs to know what network address to make a connection to. So the web browser asks the DNS “what network address does www.bbc.co.uk point to” and the DNS answers “212.58.246.92 and 212.58.246.93” (as of the time of writing). The DNS does quite a bit more than that – even ignoring the details of how the servers operate – as it can answer other kinds of questions than just what the network address of a name is. But the process works pretty much the same way whatever kind of question is asked, so we’ll concentrate on the name questions. Technically the name www.bbc.co.uk is a fully-qualified domain name, and the network address is either an IPv4 address or an IPv6 address which can be seen if we perform a lookup on www.google.co.uk instead of www.bbc.co.uk (as the BBC doesn’t have an IPv6 address as yet) :-

# host www.google.co.uk 
www.google.co.uk has address 74.125.132.94
www.google.co.uk has IPv6 address 2a00:1450:400c:c06::5e

That’s a command-line way of performing a DNS lookup, which is rather irrelevant to this discussion except that it shows just the DNS answer.

So How Does It Work?

When you perform a DNS lookup (or more usually an application performs a DNS lookup on your behalf), it makes use of a piece of software on your computer called the resolver. This is more complex than is described here, and can use mechanisms other than the DNS. But ignoring all of that, the resolver composes a question in terms that a DNS server would understand. It then sends the question to all of the DNS servers it knows about.

Hopefully one or more of those DNS servers will answer the question, and the application can get on with whatever it is doing.

If an answer is not returned, the question is sent again, and this carries on until the resolver decides that enough is enough and returns an error to the application. Which of course results in an unexpected error such as a web browser saying that Google doesn’t exist!

There’s a fair bit more to it than this of course – particularly how the DNS servers find out the answer to your question, but this is enough for now.

Nov 022013
 

Why on earth have we got this new name – Human Trafficking – for the very old crime of slavery and slave trading? Is it some kind of attempt at putting a trendy new gloss on it? It’s not a crime that should have a trendy new gloss; even ignoring the fact that it is the kind of crime that shouldn’t be glamorised in any way, there’s a very good legal reason why we should carry on calling it slavery and slave trading.

Back in the 19th century, the British unilaterally declared that slavery and slave trading would be treated the same as piracy and set about (with the assistance of the US) eliminating the African slave trade. Under the principle of jus cogens they set about hanging slavers, confiscating their assets, and freeing slaves claiming that they had a universal right to punish those who took part in the crime of slavery.

In other words, some crimes are so heinous that anyone is allowed to prosecute offenders no matter where or when the offenses took place.

By keeping the old name for the crime, we retain it’s classification as a crime subject to universal jurisdiction. This opens the possibility of setting up a court – such as the ICC – to prosecute slavers wherever in the world they are, and the possibility of empowering law enforcement units to bring slavers to justice wherever they happen to be.

And after all, the fight against slavery isn’t going too well with more slaves today than there has ever been.

Oct 252013
 

As you may have guessed from my previous post, my server is currently being upgraded so there may be episodes when it isn’t available.

Hopefully nothing dramatic.

If this distresses you bear in mind that I don’t get enough banner ad clicks to run a resilient service! At least not under the stairs.

Oct 252013
 

This is about updating FreeBSD once you have broken free of binary updates – probably not the best thing to do, but I needed to do it for various reasons. This isn’t a recommended method; merely the method I use. It is more about gathering the instructions I need.

First update the source :-

cd /usr/src
make update SVN_UPDATE=yes

Next step is to build the world :-

make -j 4 buildworld

This step takes quite a while, so it’s very helpful to add the “-j 4” to build in parallel.

The next step is to build the locally configured kernel. This usually starts with configuring it, but comparing the GENERIC configuration with the local configuration shows that in my case at the time of writing I didn’t have to re-configure.

make buildkernel KERNCONF=${NAME-OF-YOUR-CONFIG}

Once built the kernel needs to be installed :-

make installkernel KERNCONF=${NAME-OF-YOUR-CONFIG}

Next is to boot to single user mode which is done by pressing a key other than Return during the 10 second countdown, and entering boot -s at the prompt. Once booted into single user mode, the following steps need to be taken :-

# mount -u /; zfs mount -a
(To mount all filesystems with zfs in read-write mode)
# mergemaster -p
(To start the update of the configuration files)
# cd /usr/src
# make installworld
(To install the new user land)
# mergemaster
(To complete the update of the configuration files)
# make delete-old

That’s it for single-user mode. Now reboot into full multi-user and carry on …

Next step is to update the ports :-

# portsnap fetch
# portsnap update
# pkgdb -F
# cd /usr/ports/ports-mgmt/portupgrade
# make deinstall
# make install clean
# portupgrade -af --batch

This of course takes a very long time to complete.

And that should be it … seems to have been successful for me.

Oct 252013
 

Apparently this idiot thinks that all coders are exceptionally dull weirdos. I’ll quite happily admit to being a weirdo, but as to exceptionally dull … I only seem that way to the exceptionally thick, or prejudiced.

Concentrating for the moment about this journalist’s (in the loosest possible sense of the word) insult to a good number of people, we can probably deduce the following :-

  1. He doesn’t know many developers socially. If he accidentally encounters one in a social setting one of the following occurs :-
    1. The developer denies all knowledge of computers because of the prejudice of idiots like him. This is a bit of self defence we geeks learned in the past and used in the past. So we can also assume he’s a bit of a dinosaur (like me).
    2. Once he learns someone is a developer, he will climb the walls to get out of the way.
    3. He converses in his own specialised area, and anyone who runs away is classified as an exceptionally dull weirdo.
  2. If he thinks that coding is mechanistic, he is totally clueless about programming, and thinks that anyone can simply start writing code immediately. As a little hint, the majority of the time spent programming is thinking; simply grinding out code is a relatively small part of the job.
  3. Lumping coding in with car mechanics, or plumbing in a derogatory manner indicates this guy is one of those fools who think that anything technical is a low-status activity. Hope his plumber tells him to fix it himself when his next water leak occurs, or charges him double!

Now onto the main point of his ill educated rant on the subject of teaching “coding” to school children. Hopefully the government plans to teach “programming” rather than “coding”, but does he have a point? Perhaps, although it’s a bit difficult to take an idiot like this seriously.

It really depends on exactly what and how it is being taught.

If the plan is to turn out vast swarms of fully fledged developers, everyone is going to be disappointed; apart from anything else, if we were going to turn out fully fledged developers it would have a catastrophic effect on every other subject being taught. After all, it would take so much teaching time away from other subjects, there wouldn’t be enough time for Maths, English, History, etc.

But if the intention is to teach programming in a fun way (say with Logo and robots), with the intention of giving students a better idea of how computers work and how they are instructed, it could well be a good thing.

Not everyone needs to code he claims. Actually most people may find themselves coding in ways that may not be thought of as programming – setting up formula in a spreadsheet, setting up a database, automating a task in a word processor. Although none of these are “true” programming, they do share some elements with it – not least to think about the task in hand, dividing it up into sub-tasks, and setting about telling the computer how to do those tasks in a way that the computer will understand.

Does everyone need this? Perhaps not, but they will find using computers much more effective if they have a better idea of what is going on.