Page 1 of 3

Changing Amahi's DNS

Posted: Thu Jan 15, 2009 1:24 pm
by originell
Hey guys,
since I had troubles with using amahi's default external dns (opendns) I decided to change that.
Thanks to cpg who said that the option is only changeable in the database itself and GeraldW who told me the mysql pw :lol:

Okay let's start!
  • of course ssh as root into your hda

    Code: Select all

    ssh root@hda
  • Before we make any changes to the database it's better to shutdown the hda

    Code: Select all

    hdactl stop
  • Let's enter the database

    Code: Select all

    mysql -p hda demo_development
    Note: -p is password (pw for amahi's mysql db is hda) and demo_development is amahi's database
  • If everything was successfull you should now see a mysql prompt

    Code: Select all

    mysql>
    awaiting your commands..
  • let us see our current settings

    Code: Select all

    select * from settings;
    as a response you should receive something like this:

    Code: Select all

    +----+---------------+------------------------------------------+ | id | name | value | +----+---------------+------------------------------------------+ | 2 | domain | yourdomain.com | | 3 | nick | yournick | | 4 | net | 192.168.1 | | 5 | netmask | 255.255.255.0 | | 6 | gateway | 1 | | 7 | api-key | yourapikeyhere | | 8 | external-dns1 | opendnsip1 | | 9 | external-dns2 | opendnsip2 | | 10 | self-address | 2 | | 11 | theme | 2 | +----+---------------+------------------------------------------+
  • Okay now comes the funpart ;)

    Code: Select all

    update settings set value='your new dns1 ip here' where value='the opendnsip1 from the database';
    if everything worked well you should see something like that:

    Code: Select all

    Query OK, 1 row affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0
    obviously you need to do the same thing for external-dns2..
  • When done press CTRL+D
  • let's start hda again

    Code: Select all

    hdactl start
hope it helped.. would be cool to have that as an option in the setup!

greets from austria

Re: Changing Amahi's DNS

Posted: Thu Mar 12, 2009 5:11 am
by rgmhtt
Hey guys,
since I had troubles with using amahi's default external dns (opendns) I decided to change that.
Thanks to cpg who said that the option is only changeable in the database itself and GeraldW who told me the mysql pw :lol:


[*] Let's enter the database

Code: Select all

mysql -p hda demo_development
Note: -p is password (pw for amahi's mysql db is hda) and demo_development is amahi's database
[*] If everything was successfull you should now see a mysql prompt

Code: Select all

mysql>
awaiting your commands..
Well, for me I get the mysql help information. This tends to mean it does not like either the password or the database name or some other option is needed.

I see that the mysql config file, /etc/my.cnf points to /var/lib/mysql for the data dir, and that there is a demo_development directory there. I assume that this implies a demo_development database. So perhaps my password is not hda? Is it possible at install time I overrode this?

Re: Changing Amahi's DNS

Posted: Thu Mar 12, 2009 5:26 am
by moredruid
1st solution:
change your syntax... if you read carefully you can see you tell mysql to use password "hda" on database "demo_development"... it should be the other way around.
from the mysql support page:

Code: Select all

shell> mysql --user=user_name --password=your_password db_name
or short:

Code: Select all

shell> mysql -u username -p password db_name
or shorter (implied root login):

Code: Select all

shell: mysql -p rootpassword dbname
2nd solution:
lose the "hda" part, log in to mysql
change to database hda:

Code: Select all

use hda
you'll get a "now using database hda" as response
then do your IP change thingie

3rd solution:
installing phpmyadmin, this makes changing these values much easier since you don't have to dabble in mysql itself, you have a nice web front-end for it.

Since phpmyadmin can be a bit of a security issue (quite easily sniffed/spoofed) I always make a point of it by installing it and removing it when I'm done.

Re: Changing Amahi's DNS

Posted: Thu Mar 12, 2009 5:32 am
by rgmhtt
Oh, and I want to use phpMyAdmin on the database, and I need the table name as well as the database name...

Re: Changing Amahi's DNS

Posted: Thu Mar 12, 2009 5:38 am
by rgmhtt
3rd solution:
installing phpmyadmin, this makes changing these values much easier since you don't have to dabble in mysql itself, you have a nice web front-end for it.

Since phpmyadmin can be a bit of a security issue (quite easily sniffed/spoofed) I always make a point of it by installing it and removing it when I'm done.
I did install it. The FAQ shows how to compose a url to access a database and you need the database and table name. So I was trying to follow your example to hopefully get in enough to use phpmyadmin instead...

Re: Changing Amahi's DNS

Posted: Thu Mar 12, 2009 5:51 am
by rgmhtt
Success! I am into the database with phpmysdmin!

All I had to do was use the url:

http://hda/phpMyAdmin/index.php?server= ... evelopment


then I just selected the table settings and I am on my way to getting dhcp working my way.

Re: Changing Amahi's DNS

Posted: Thu Mar 12, 2009 6:08 am
by cpg
excellent!

keep in mind that until we support this from the main interface (maybe not too long?), it may break with some updates, so you may have to do it again in that case. sorry.

Re: Changing Amahi's DNS

Posted: Thu Mar 12, 2009 6:18 am
by rgmhtt
Getting back on the subject of changeing Amahi's DNS (I was pointed to this thread to make changes to the dhcpd defaults),

I run my own DNS server here for my production domain of htt-consult.com. Is there something special provided by openDNS server that I need to consider before changing Amahi to point to my local DNS server (on a different subnet than where I will be placing Amahi).

Re: Changing Amahi's DNS

Posted: Thu Mar 12, 2009 6:53 am
by cpg
nothing special about opendns.

Re: Changing Amahi's DNS

Posted: Sun Sep 27, 2009 8:42 am
by salocinbake
Somewhat related to this thread.

A simple solution for me to create settings on the DNS: simply create a account with Opendns.
Add your current IP to your account. (under network)
Then added a few restrictions / shortcuts to my account.
Now my wife can't go to http://www.cutekittens.com
Voila.

Cpg, I tried to add this to the wiki, but I don't know how to start a new title... :oops:
I will elaborate more on the wiki...

Image