myownb3.com problems

Got problems with your B2 or B3? Share and get helped!
thunder
Posts: 25
Joined: 12 May 2015, 09:22

Re: myownb3.com problems

Post by thunder » 24 Sep 2019, 15:19

No I find the problem, there's one error on patch
Sorry.

MouettE
Site admin
Posts: 269
Joined: 06 Oct 2011, 19:45

Re: myownb3.com problems

Post by MouettE » 24 Sep 2019, 21:20

Gordon wrote:
24 Sep 2019, 13:46
@MouettE
Would it be possible to extend the easyfind API to return the IP address associated with a specific name? That would at least allow us to query the address and possibly use that in a service that updates the local hosts file.
The easiest way to do that is to query directly the DNS servers with dig with something like : dig @ns1.excito.org <name>.myownb3.com

The DNS team at rodeus is working on the issue, we should have more news tomorrow morning. Thanks for your patience.

Gordon
Posts: 1366
Joined: 10 Aug 2011, 03:18

Re: myownb3.com problems

Post by Gordon » 25 Sep 2019, 06:24

Good point.

Sharing my script for those interested:

Code: Select all

#!/bin/sh

if [ -z "$1" ]; then
    myname=$(echo $0 | sed "s/^.*\/\([^\/][^\/]*\)$/\1/")
    echo "Usage: $myname <identity>"
    exit
fi

newip=$(dig @ns1.excito.org $1.myownb3.com | grep -v "^[;]" | grep -v "^$" | awk '{print $5}')
oldip=$(grep "$1.myownb3.com" /etc/hosts | awk '{print $1}')

if [ -z "${oldip}" ]; then
    #ensure newline at end of file
    sed -i -e '$a\' /etc/hosts
    # append record
    echo "add record for $1.myownb3.com (${newip})"
    echo -e "${newip}\t$1.myownb3.com" >> /etc/hosts
    /etc/init.d/dnsmasq restart
    exit
fi

if [ -z "${newip}" ]; then
    echo "ERROR: record not found"
    exit
fi

if [ "${newip}" != "${oldip}" ]; then
    # replace existing record
    echo "update record for $1.myownb3.com (${oldip} => ${newip})"
    sed -e "s/^${oldip}\s/${newip}\t/" -i /etc/hosts
    /etc/init.d/dnsmasq restart
    exit
fi

josvergeer
Posts: 6
Joined: 25 Dec 2017, 04:11

Re: myownb3.com problems

Post by josvergeer » 04 Oct 2019, 08:50

All is working again.
Thanks for your effort.

Jos

Post Reply