August 30, 2014

Statische DNS Einträge mit einer Fritzbox

Betreibt man hinter seiner Fritzbox einen Server, möchte man ihn möglicherweise über den DNS-Namen erreichen können. Da man einem Server aber sinnvollerweise eine statische IP-Adresse vergibt, wird diese von der Fritzbox nicht in den DNS eingetragen. In einer Konfigurationsdatei kann man den Host entsprechend hinterlegen.

Wichtiger Hinweis: man sollte die Konfigurationsdateien der Fritzbox nur bearbeiten, wenn man weiß, wie man eine gebrickte Fritzbox wiederbelebt. Ich übernehme keine Haftung für die Richtigkeit dieser Anleitung.

  1. Das DHCP-Lease in der Fritzbox entfernen, falls noch eines vorhanden ist. Das geht in der Weboberfläche über Heimnetzwerk > Netzwerk, indem man auf das rote X beim entsprechenden Host klickt.
  2. Falls noch nicht geschehen, telnet aktivieren und einloggen.
  3. multid stoppen:
    multid -s
  4. Die ar7.cfg bearbeiten:
    nvi /var/flash/ar7.cfg
    in dieser Datei gibt es einen Abschnitt “landevices”, wo man einen Block wie diesen hier einfügen kann (Werte entsprechend anpassen):
    } {                                                                                                     
    		ip = 192.168.178.5;                      
    		name = "server";                            
    		mac = 12:34:56:78:90;
    		medium = medium_unknown;                                         
    		type = neightype_unknown;                                       
    		staticlease = no;                                                                                    
    } {
  5. Nach einem Reboot der Fritzbox findet sich ein entsprechender Eintrag im DNS.

Update 11. Februar 2018: Nach der MAC-Adresse fehlte ein Semikolon. Danke an Svenibaer.

August 22, 2014

Broken Reset Function on a Server

Since a few days we have problems with a server. It sometimes freezes and the only way to make it work again is to reset it. So a few days ago I got a SMS from the monitoring system that alerted me that the server was down again.

After checking, I noticed that it was really down and I decided to reset it using the Reset service of our data center. I sent the reset request, but the server didn’t come back to life after a few minutes. At first I thought it was completely broken. But that wasn’t the case. Literally the reset hardware was broken, so a technican had to walk over to the server and reset it. That’s murphy’s law I guess…

August 21, 2014

Windows Server Backup Fails When Vhds Are Mounted Inside Hyper v Virtual Machines

We have a Virtual Machine with Windows Server 2008 R2 that has VHDs mounted. Since we had mounted the VHDs, Windows Server Backup on the Server 2008 R2 Hyper-V host always failed. When we detached the VHDs again, the backup would run just fine. Unfortunately, Windows Server Backup once again is not able to produce a helpful error message. The only indication in the logs is the following message that at least points you to the right VM:

The number of volumes reverted does not match the number of volumes in the snapshot set for virtual machine 'ourvm' (Virtual machine ID 123456789).

We decided to unmount the VHDs prior to the backup and then mount them again afterwards.

August 20, 2014

Localized Names of Users and Groups in Windows

You know the “Authenticated Users” group in Windows? Microsoft decided to localize its name. For example, in a german Windows it is called “Authentifizierte Benutzer”. While I don’t want to criticize the decision to localize the name, I want to criticize the way it is implemented in some parts of Windows.

If you take a look at icacls, you can write a script that does not depend on the locale of the installed system. Instead of “Everyone” you would just use its SID S-1-5-11 (which does not depend on the locale) according to the list of well-known SIDs in Windows.

That’s ok. Now suppose you want to create a network share using net share. Additionally, you want to restrict access to that share to the “Authenticated Users” group (using the grant argument). Well. No. It is just impossible to do that in a way that does not depend on the locale. The grant argument will only accept the Name of a group, but not the SID. (Additionally, it will fail with a not very helpful error 1332 “No mapping between account names and security IDs was done” if you pass a SID…).

With the help of Google you can find a solution (german) that uses wmic to get the localized name and this is what I used in the end:

set AuthenticatedUsersSid=S-1-5-11
for /f "tokens=2 delims==" %%a in ('"wmic path win32_account where SID='%AuthenticatedUsersSid%' get name /value"') do (
set AuthenticatedUsersName=%%a
goto :loop_end
)
:loop_end
echo Found Authenticated Users localized name: %AuthenticatedUsersName%

But anyway, why doesn’t that work consistently?

August 19, 2014

Why Disabling Screen Blanking Is a Good Idea

Some Linux distributions (for example Debian) in their default configuration blank the screen after a certain time of inactivity. Until recently, I didn’t disable screen blanking on my servers.

But recently one server started freezing once a month or so. Unfortunately, it doesn’t have an IPMI so I have to send a technician over to have a look at it. The problem is: if the screen is blanked you cannot see the messages of the kernel and if the kernel has died, you cannot un-blank the screen.

What I learned from this: Under Debian always remember to set:

BLANK_TIME=0
BLANK_DPMS=off
POWERDOWN_TIME=0

in /etc/kbd/config

Powered by Hugo & Kiss.