Changing Amahi's DNS

originell
Posts: 2
Joined: Thu Jan 15, 2009 1:03 pm

Changing Amahi's DNS

Postby originell » Thu Jan 15, 2009 1:24 pm

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

User avatar
rgmhtt
Posts: 421
Joined: Sun Jan 11, 2009 9:26 am

Re: Changing Amahi's DNS

Postby rgmhtt » Thu Mar 12, 2009 5:11 am

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?

User avatar
moredruid
Expert
Posts: 791
Joined: Tue Jan 20, 2009 1:33 am
Location: Netherlands
Contact:

Re: Changing Amahi's DNS

Postby moredruid » Thu Mar 12, 2009 5:26 am

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.
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D2173656C7572206968616D41snlbxq' | dc
Galileo - HP Proliant ML110 G6 quad core Xeon 2.4GHz, 4GB RAM, 2x750GB RAID1 + 2x1TB RAID1 HDD

User avatar
rgmhtt
Posts: 421
Joined: Sun Jan 11, 2009 9:26 am

Re: Changing Amahi's DNS

Postby rgmhtt » Thu Mar 12, 2009 5:32 am

Oh, and I want to use phpMyAdmin on the database, and I need the table name as well as the database name...

User avatar
rgmhtt
Posts: 421
Joined: Sun Jan 11, 2009 9:26 am

Re: Changing Amahi's DNS

Postby rgmhtt » Thu Mar 12, 2009 5:38 am

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...

User avatar
rgmhtt
Posts: 421
Joined: Sun Jan 11, 2009 9:26 am

Re: Changing Amahi's DNS

Postby rgmhtt » Thu Mar 12, 2009 5:51 am

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.

User avatar
cpg
Administrator
Posts: 2596
Joined: Wed Dec 03, 2008 7:40 am
Contact:

Re: Changing Amahi's DNS

Postby cpg » Thu Mar 12, 2009 6:08 am

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.
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 8GB RAM, 1TBx2+3TBx1

User avatar
rgmhtt
Posts: 421
Joined: Sun Jan 11, 2009 9:26 am

Re: Changing Amahi's DNS

Postby rgmhtt » Thu Mar 12, 2009 6:18 am

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).

User avatar
cpg
Administrator
Posts: 2596
Joined: Wed Dec 03, 2008 7:40 am
Contact:

Re: Changing Amahi's DNS

Postby cpg » Thu Mar 12, 2009 6:53 am

nothing special about opendns.
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 8GB RAM, 1TBx2+3TBx1

User avatar
salocinbake
Posts: 53
Joined: Sun Dec 14, 2008 6:31 pm
Location: Niagara Falls

Re: Changing Amahi's DNS

Postby salocinbake » Sun Sep 27, 2009 8:42 am

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
My HDA: Pentium dual cpu E2200 @2.2GHz 4GB of Ram, 1T+1,5T hard drive.

Who is online

Users browsing this forum: No registered users and 2 guests