How do I make custom entries into the local DNS?

camnz
Posts: 6
Joined: Mon Mar 29, 2010 7:03 pm

How do I make custom entries into the local DNS?

Postby camnz » Mon Mar 29, 2010 7:22 pm

Hey there,

I've got my first Amahi 5 server up and running and need to do some fine tuning... I want to get rid of my current f6 web development server and integrate its websites, DB and local DNS into the new amahi box.

The websites are easy - virtual hosts are all set up. DB is easy too.

But how do I go about adding my custom entries into the local DNS on the Amahi box?

I've installed the Webmin module and can use it to see the Amahi entries in Bind. But how exactly do I add my the entries to my local dev websites?

e.g. the urls for my Amahi apps are http://appname.home.sm/
I want to add http://website1.sm/, http://website2.sm etc etc where they point to websites either on the Amahi box or the current f6 box.

I use MyDNS to manage the DNS on the f6 box - would that be an option on the Amahi box? Would it screw with the Amahi run DNS?

Any help much appreciated!
-Cam

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

Re: How do I make custom entries into the local DNS?

Postby moredruid » Tue Mar 30, 2010 12:15 am

check your /etc/nsswitch.conf
if it has the following entry:

Code: Select all

hosts: files dns
you can just add the entries to your /etc/hosts file.
they should then resolve properly (i.e. when the DNS server gets a lookup request it will first check /etc/hosts, then resolv.conf (I think) and then do an external lookup if nothing resolves).
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

camnz
Posts: 6
Joined: Mon Mar 29, 2010 7:03 pm

Re: How do I make custom entries into the local DNS?

Postby camnz » Tue Mar 30, 2010 5:01 pm

check your /etc/nsswitch.conf
if it has the following entry:

Code: Select all

hosts: files dns
you can just add the entries to your /etc/hosts file.
they should then resolve properly (i.e. when the DNS server gets a lookup request it will first check /etc/hosts, then resolv.conf (I think) and then do an external lookup if nothing resolves).
Hey - thanks for that.

Still a bit stuck though.

I've checked /etc/nsswitch.conf and it has the correct entry.

I've added the following lines to /etc/hosts

Code: Select all

127.0.0.1 website1.sm website1.home.sm 192.168.1.4 website2.sm
So, website1 should resolve to the local server (Amahi box) and website2 should point to the old server.

I can browse and ping the sites when working on the Amahi box terminal, but not when using my Mac.

Will the Amahi server be using its own hosts file when looking up dns requests from other computers on the network, or just when it is making a dns request of its own?

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

Re: How do I make custom entries into the local DNS?

Postby moredruid » Tue Mar 30, 2010 10:50 pm

the named daemon works like configured in nsswitch.conf for every DNS request be it local or remote.
I presume you've flushed your DNS entries on the Mac?
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

camnz
Posts: 6
Joined: Mon Mar 29, 2010 7:03 pm

Re: How do I make custom entries into the local DNS?

Postby camnz » Wed Apr 07, 2010 9:08 pm

the named daemon works like configured in nsswitch.conf for every DNS request be it local or remote.
I presume you've flushed your DNS entries on the Mac?
Sorry for the lag - been busy with other stuff!

Just given this another nudge and still having the same problems. Addresses listed in hosts resolve fine when using the terminal, but not on my mac or from the old server (now using DHCP from Amahi box with static ip).

The nsswitch.conf on Amahi looks like this:

Code: Select all

[cam@localhost /]$ cat /etc/nsswitch.conf # # /etc/nsswitch.conf # # An example Name Service Switch config file. This file should be # sorted with the most-used services at the beginning. # # The entry '[NOTFOUND=return]' means that the search for an # entry should stop if the search in the previous entry turned # up nothing. Note that if the search failed due to some other reason # (like no NIS server responding) then the search continues with the # next entry. # # Legal entries are: # # nisplus or nis+ Use NIS+ (NIS version 3) # nis or yp Use NIS (NIS version 2), also called YP # dns Use DNS (Domain Name Service) # files Use the local files # db Use the local database (.db) files # compat Use NIS on compat mode # hesiod Use Hesiod for user lookups # [NOTFOUND=return] Stop searching if not found so far # # To use db, put the "db" in front of "files" for entries you want to be # looked up first in the databases # # Example: #passwd: db files nisplus nis #shadow: db files nisplus nis #group: db files nisplus nis passwd: files shadow: files group: files #hosts: db files nisplus nis dns hosts: files dns # Example - obey only what nisplus tells us... #services: nisplus [NOTFOUND=return] files #networks: nisplus [NOTFOUND=return] files #protocols: nisplus [NOTFOUND=return] files #rpc: nisplus [NOTFOUND=return] files #ethers: nisplus [NOTFOUND=return] files #netmasks: nisplus [NOTFOUND=return] files bootparams: nisplus [NOTFOUND=return] files ethers: files netmasks: files networks: files protocols: files rpc: files services: files netgroup: nisplus publickey: nisplus automount: files nisplus aliases: files nisplus
The hosts file on Amahi looks like this:

Code: Select all

[cam@localhost /]$ cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.1 website1.sm website1.home.sm 192.168.1.4 website2.sm
I have flushed the DNS cache on my Mac with:

Code: Select all

dscacheutil -flushcache
I can't ping website1.sm or website2.sm from anywhere but the terminal of the Amahi box.

Any suggestions?

-Cam

camnz
Posts: 6
Joined: Mon Mar 29, 2010 7:03 pm

Re: How do I make custom entries into the local DNS?

Postby camnz » Wed Apr 07, 2010 9:43 pm

I think I may have cracked it!

Been playing with the Aliases section of the Amahi Networking config - adding entries there for virtual hosts on the old server is getting results. I'll just need to go through and create a new alias for each vhost to cater for the *.home.sm name rather than the current *.sm name.

Will let you know how I get on.
-Cam

Who is online

Users browsing this forum: No registered users and 18 guests