If Linux (Ubuntu) cannot resolve hostname

February 18th, 2012

I used a couple of hours today to find out why my laptop ( Ubuntu 10.04 ) could resolve the hostname of all other devices on my network, but my server ( Ubuntu Server 10.04 ) and desktop ( Ubuntu 11.10 ) could not. First I suspected it to be a misconfiguration in Samba, but after lot of searching in the /etc/samba/smb.conf i found that it didn’t have anything to do with my problem. It was not worthless because I learned a lot more about Linux and networking, and one thing that might be useful to others is this little commented line in the Samba config file:

name resolve order = lmhosts host wins bcast

Here you can change the order the different network protocols that should be resolved. What pointed me in the right direction was the command simple but very useful Linux command “dig” which stands for “domain information groper”. By simply typing:

dig

Which is very useful for troubleshooting network problems in general. Test it yourself by typing e.g.:

dig wikipedia.com

and you will get a very nice output on how the domain name is resolved. The part that helped me a was the third next line in the output:

; <<>> DiG 9.7.0-P1 <<>> wikipedia.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11524
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3

;; QUESTION SECTION:
;wikipedia.com. IN A

;; ANSWER SECTION:
wikipedia.com. 1305 IN A 208.80.152.201

;; AUTHORITY SECTION:
wikipedia.com. 82430 IN NS ns2.wikimedia.org.
wikipedia.com. 82430 IN NS ns0.wikimedia.org.
wikipedia.com. 82430 IN NS ns1.wikimedia.org.

;; ADDITIONAL SECTION:
ns0.wikimedia.org. 1420 IN A 208.80.152.130
ns1.wikimedia.org. 1420 IN A 208.80.152.142
ns2.wikimedia.org. 1420 IN A 91.198.174.4

;; Query time: 11 msec
;; SERVER: 192.168.10.1#53(192.168.10.1)
;; WHEN: Sat Feb 18 16:09:39 2012
;; MSG SIZE rcvd: 162

On my laptop, the one that could resolve hostname the output was:

;; SERVER: 208.122.23.22#53(208.122.23.22)

This DNS server belongs to UnblockUS which is a service to unblock services that is for USA only. I used it to watch netflix.com in Norway. On the other computers the command printed out my ISP ‘s DNS primary server and there is no way a local hostname can be resolved by using a DNS server that is not connected to your local network (LAN). The reason that it worked  on my laptop I believe is that my UnblockUS subscription had expired and then my laptop used my router as a DNS server instead.

So finally, here is the Solution:

I checked my /etc/resolv.conf file and found that Ubuntu automatically fetched my ISP’s DNS server IPs and saved it here every time the network was getting the IP address from the DHCP server on the router. There is useless just to change the /etc/resolv.conf file because then it is overwritten every time the network daemon  starts. If you are using Gnome interface, right click on network icon > Edit Connections > IPv4 (tab) > Automatic (DHCP) addresses only (from the dropdown menu) and enter the IP address to your router in the DNS servers: field. The location may vary depending on which Ubuntu version you have and if you have wireless or wired connection, but you will find it if you look around the dialogue boxes.

On my headless server I used static DHCP on my router. I changed this to be a static IP on my server instead by editing /etc/network/interfaces using nano:

sudo nano /etc/network/interfaces

Before:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

After:

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.10.2
netmask 255.255.255.0
gateway 192.168.10.1

Change your /etc/network/interfaces according to your network configuration. Edit your /etc/resolv.conf  and add your router as nameserver:

nameserver 192.168.10.1

Feel free to comment if you find errors or have any questions.

 

Nynorskens siste hjertesukk

January 28th, 2012

Jeg forstår hjertesukket til nynorskbrukere om dagen. Dialekten vår er en veldig viktig del av identiteten vår. Jeg kommer fra Hurum i Buskerud og snakker breiere enn min samboer som er født og oppvokst på vestkanten i Oslo. Jeg har fått mye pepper for dialekten min, og jeg tar det personlig. På den måten forstår jeg hva nynorskbrukere føler, men jeg ville aldri drømme om å kjempe for at dialekten min skulle være et skriftspråk. Brukere av nynorsk har et tilleggsargument som er Ivar Aasens arbeid, men vi burde komme over nasjonalromantikken nå. Ivar Aasens arbeid var omdiskutert, og det heller ikke vanskelig å høre at nynorsken er preget av at Ivar Aasen var fra vestlandet, nærmere bestemt Ørsta. Han forteller i forordet til Prøver af Landsmaalet at de beste dialektene var de i HardangerVoss og Sogn, mens «de nordenfjeldske dialekter er blant de slettere eller mere forvanskede». Aasen var med andre ord ikke særlig nådig i sin utvelgelse av dialekter.

Norsk er under hardt angrep fra engelsk og vi står sterkere sammen hvis vi skal beholde gode norske ord og uttrykk. Hva som er gode norske ord og uttrykk kan selvsagt diskuteres ihjel, men det er lite fruktbart. Det er alltid litt trist å høre folk bruke engelske ord eller fraser i stedet for det jeg vil kvalifisere som gode norske ord og uttrykk.

Det er på mange måter resurskrevende å ha to skriftspråk. Det koster penger, selv om dette er det dårligste argumentet så gjør det nå en gang det. Den resursbruken som bekymrer meg mest er norskundervisningen hvor norsk ungdom stiller med et handikap når de må lære to variasjoner av morsmålet sitt. Det blir mindre tid til lek og øvelse på rettskrivning av den enkle grunn at det er krevende for ungdom å lære to skriftspråk. Det jeg ønsker meg er en større toleranse for dialekter og ett skriftspråk. Mange vil nok argumentere for at det er lett for meg å si som kommer fra en del av landet hvor dialekten er veldig lik bokmål, og det er selvsagt et poeng, men ikke et godt argument i debatten om to skriftspråk av den enkle grunn at det er bokmål som er det skriftspråket 85–90% velger å bruke. Vi er rett og slett et for lite land til å skulle holde liv i to skriftspråk.

Det er på tide å komme over dansketiden, den er en del av historien vår enten vi liker det eller ikke. Wergeland var en klok mann, og han kommer til å få viljen sin i denne saken også. Det er bare et tidsspørsmål, i mellomtiden er norsk skoleungdom taperne for nynorskens kunstige åndedrett.

Open letter to Livescribe

January 27th, 2012

Hi

I am a student at University of Oslo and a happy and proud user of a Livescribe pen. At the university we are trained to use Linux. Which distro we choose does not matter, so we are free to use Ubuntu which provide us a great community where Ubuntu users can get fantastic support and much more. Ubuntu also comes with a good software package handlers called “Software Center” or “Synaptic”. I have Windows installed side by side with Ubuntu on my computers, but the only reason for booting into Windows for me now is to synchronize my livescribe pen or watch and hear recorded lectures. The fact that there is no Linux version of LD is starting to get more and more time consuming, because I always do my exercises in Ubuntu. I will urge you to make a port for Linux, and if you do, Debian/Ubuntu would be a good place to start. Because Linux is very common on universities around the world I think this extra expenses porting LD to linux will pay off because Livescribe will (I believe) reach a much broader range of your target group. I hope you will take this into consideration and create a Linux version of LD. I do not have the programming skills to make a port myself, but if I could I would have done it for free. So my solicitation to Livescribe is to contact the community at e.g. Ubuntu (www.ubuntuforums.com) and ask if anybody is interested in cooperate with Livescribe to create a Linux port.

I will post this message on different forums to see if I can get some response from the community, and if I do I will let you know. In the mean time I would love to hear Livescribes plans on this subject.

Thank you!

Thomas Gabrielsen

Mozilla’s Robert O’Callahan MediaStream Processing demos

January 21st, 2012

Check out Mozilla’s Robert O’Callahan MediaStream Processing demos:
https://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/rocallahan@mozilla.com-6ac1418daa2e/

You need Firefox experimental nightly build:
http://people.mozilla.org/~roc/stream-demos/

You should try them, it is worth spending some time playing around with these demos. Start at the top of the list, and work yourself down, one at the time.

View shared calendars for free Google Apps accounts

January 21st, 2012

I have for a long been a Google Apps user and synchronizing e-mail, calendars and contacts with my iPhone works flawlessly. My partner and I are sharing calendars but until today it has been impossible to view my partner’s calendar on my iPhone. The reason for this is that the “administer security controls” where you can add shared calendars is “are only available for Google Apps Premier and Education customers” (look at the bottom of the page).  Today I found a workaround, at least for iPhone users but I guess it will work for every smart phone that support CalDav calendar synchronization. This is how I did it:

  1. Go to http://support.google.com/mobile/bin/answer.py?hl=en&answer=151674 and follow the instructions on how set up your (i)phone’s CalDAV synch.
  2. Open up https://www.google.com/calendar/hosted/ditt_domene/iphoneselec and select the calendars you want to synch
  3. Go to your phone’s calendar settings and select the calendars you want to view. On an iPhone: Open up your calendar, click on the “Calendars”  button in the upper left corner, select the calendars you want to view.

That’s it!