Koozali.org: home of the SME Server

Best way to customize domain records?

Offline jahlewis

  • *
  • 151
  • +0/-0
    • http://www.arachnerd.com/
Best way to customize domain records?
« on: November 05, 2008, 11:06:00 PM »
What is the best way to customize the domain records listed in /var/services/tinydns/root/data?

I need my smeserver to direct internal users to an internal address for a domain that is managed externally.  The external DNS info points to an external NAT address, so I need internal users to resolve the internal address for the entire domain, mx records etc.

Are there DB commands I can use to replace the stock dns records with custom ones?  If not, what is the best way to gin up a template that will do this?

For example, I'd like /var/services/tinydns/root/data to change from this:
Code: [Select]
# NS Records
.avenue.org::hera.jmrl.org

# MX Records
@avenue.org::hera.jmrl.org

# A Records for domains
+avenue.org:166.61.234.91

# A Records for Hosts in avenue.org
=mail.avenue.org:10.0.8.5
+monticello.avenue.org:10.0.8.5

to this:
Code: [Select]
# NS Records
.avenue.org::monticello.avenue.org

# MX Records
@avenue.org::monticello.avenue.org

# A Records for domains
+avenue.org:10.0.8.5

# A Records for Hosts in avenue.org
=mail.avenue.org:10.0.8.5
+monticello.avenue.org:10.0.8.5
+aries.avenue.org:166.61.234.92
+*.aries.avenue.org:166.61.234.92
............

Offline jahlewis

  • *
  • 151
  • +0/-0
    • http://www.arachnerd.com/
Re: Best way to customize domain records?
« Reply #1 on: November 06, 2008, 04:45:11 AM »
I tried the custom-template route with a test domain, but this appears not to work:

# create custom template with custom domain information
Quote
pico /etc/e-smith/templates-custom/var/service/tinydns/root/data/80avenue123TestRecords
Code: [Select]
# Avenue123RestRecords
# NS Records
.avenue123.org::hera.jmrl.org
# MX Records
@avenue123.org::monticello.avenue123.org
# A Records for domains
+avenue123.org:10.0.8.5
# A Records for Hosts in avenue.org
=mail.avenue123.org:10.0.8.5
+monticello.avenue123.org:10.0.8.5
+www.avenue123.org:10.0.8.5
# expand the templates to make the data file
Quote
expand-template /var/service/tinydns/root/data
# compile the data file
Quote
cd /var/service/tinydns/root
tinydns-data
# restart the dns service
Quote
/etc/init.d/tinydns restart

If I dig or try to ping the above A records on the local system, they are not recognized...  Am I missing something here?
............

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Best way to customize domain records?
« Reply #2 on: November 06, 2008, 10:23:48 AM »
jahlewis

Quote
I need my smeserver to direct internal users to an internal address for a domain that is managed externally.  The external DNS info points to an external NAT address, so I need internal users to resolve the internal address for the entire domain, mx records etc.

Not sure I fully understand you, but wouldn't you just configure that domain in the Domains panel to resolve locally (intead of resolving to Internet DNS servers). That way when local users type in the URL they will resolve locally and receive the local website etc. You would have that domain configured as a virtual domain pointing to an ibay on your server for local users.

External users will lookup external DNS records and be directed to the external site.

You can also selectively tell which host (ie www, mail, ftp etc) for which domain to resolve where in the Hostname and addresses panel. I think you need to reboot after changing these.
« Last Edit: November 06, 2008, 10:29:47 AM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline jahlewis

  • *
  • 151
  • +0/-0
    • http://www.arachnerd.com/
Re: Best way to customize domain records?
« Reply #3 on: November 06, 2008, 01:18:40 PM »
managing domains via the panel only lets you control A records.  You can't control the domain's default IP, nor its MX record or NS records.  This is what I need changed.
............

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Best way to customize domain records?
« Reply #4 on: November 06, 2008, 01:46:05 PM »
jahlewis

Hostname and addresses panel ?
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline jahlewis

  • *
  • 151
  • +0/-0
    • http://www.arachnerd.com/
Re: Best way to customize domain records?
« Reply #5 on: November 07, 2008, 04:09:35 AM »
OK, so the above changes appear to be in the system, so why can't I resolve them regularily?

If I do the lookup on the local server, it returns the correct information
Quote
[root@hera tinydns]# dig @localhost monticello.avenue123.org

; <<>> DiG 9.2.4 <<>> @localhost monticello.avenue123.org
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23941
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;monticello.avenue123.org.      IN      A

;; ANSWER SECTION:
monticello.avenue123.org. 86400 IN      A       10.0.8.5

;; AUTHORITY SECTION:
avenue123.org.          259200  IN      NS      hera.jmrl.org.

;; ADDITIONAL SECTION:
hera.jmrl.org.          86400   IN      A       166.61.234.91

;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Nov  6 22:04:24 2008
;; MSG SIZE  rcvd: 98

If try to ping the above address on the server itself, it does not resolve...

Quote
[root@hera tinydns]# ping monticello.avenue123.org
ping: unknown host monticello.avenue123.org

What am i missing?
............

Offline jahlewis

  • *
  • 151
  • +0/-0
    • http://www.arachnerd.com/
Re: Best way to customize domain records?
« Reply #6 on: November 10, 2008, 07:44:41 PM »

This thread: http://forums.contribs.org/index.php/topic,36793.0.html

mentions this RPM :http://mirror.contribs.org/smeserver/releases/7/smedev/i386/RPMS/smeserver-tinydns-public-1.0.0-4.el4.sme.noarch.rpm

But I'm not finding it in any of the SME repositories, but it appears in http://fisheye1.cenqua.com/browse/smeserver/smeserver-tinydns-public as being somewhat maintained.

Any idea of where I can find the latest version to install and see if I can use this approach to customizing a particular domain's records?
............

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Best way to customize domain records?
« Reply #7 on: November 10, 2008, 10:39:35 PM »
jahlewis

That rpm is to make sme into a public DNS server, which is not recommended unless you are a very experienced admin and know what you are doing.
If you have to ask questions here, then you don't know what you are doing sufficiently well to be running a public DNS server.
« Last Edit: November 10, 2008, 10:51:56 PM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline jahlewis

  • *
  • 151
  • +0/-0
    • http://www.arachnerd.com/
Re: Best way to customize domain records?
« Reply #8 on: November 11, 2008, 01:11:46 AM »
Thanks Mary, but
1) your reply did not answer or help with any of my questions, so is it worth it to presume?
2) I currently run several public DNS servers (running BIND), so do understand DNS records etc.
3) I am trying to leverage smeserver to be a more customizable internal DNS server, but since adding my custom records to the tinydns/root/data for a specific domain does not work, I was hoping to find the tinydns.public rpm so I could figure out how it worked with custom data files.

Do you have enough experience to answer or help me here?
............

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Best way to customize domain records?
« Reply #9 on: November 11, 2008, 09:17:10 AM »
jahlewis

Have you actually tried making changes in the Hostnames and addresses panel for the actual domain(s) in question ?
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline jahlewis

  • *
  • 151
  • +0/-0
    • http://www.arachnerd.com/
Re: Best way to customize domain records?
« Reply #10 on: November 11, 2008, 12:40:41 PM »
Yes, but the hostnames panel does not allow me to change the default address for a domain, or the mx records.  I say above how I added a custom template with the domain entries I want, rather than going through the domain and hostname panels.  The script in the templates folder that generates the tinydns/root/data file generates the data from the domains/hostnames templates, and I'm not savvy enough with perl (or templating)  to overwrite something already generated by the default script...
............

Offline jahlewis

  • *
  • 151
  • +0/-0
    • http://www.arachnerd.com/
Re: Best way to customize domain records?
« Reply #11 on: November 14, 2008, 02:49:50 PM »
I'm seeing smeserver-tinydns-public in the sourceforge list (http://smeserver.cvs.sourceforge.net/viewvc/smeserver/smeserver-tinydns-public/), with a spec version of 1.6, but no built RPM's in any of the repositories.  What would be involved to get this rpm built?
............

Offline chrismaltby

  • *
  • 6
  • +0/-0
Re: Best way to customize domain records?
« Reply #12 on: December 02, 2008, 12:56:03 AM »
While folks are asking - put me down as someone who would appreciate a build of the current tinydns-public RPM. I've got an old build with a bunch of (now fixed) bugs that I have to patch every time it needs to be re-installed...
« Last Edit: December 02, 2008, 12:58:31 AM by chrismaltby »

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Best way to customize domain records?
« Reply #13 on: December 02, 2008, 11:20:32 AM »
I'm seeing smeserver-tinydns-public in the sourceforge list (http://smeserver.cvs.sourceforge.net/viewvc/smeserver/smeserver-tinydns-public/), with a spec version of 1.6, but no built RPM's in any of the repositories.  What would be involved to get this rpm built?
Launch a bug in the bugtracker, but I guess there is no maintainer (anymore).
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline styx

  • *
  • 6
  • +0/-0
Re: Best way to customize domain records?
« Reply #14 on: April 14, 2009, 10:21:32 AM »
Hi there,
I need MX record to be customized.
I've tried this:
1. edited /var/service/tinydns/root/data
2. cd /var/service/tinydns/root && tinydns-data
3. /etc/init.d/tinydns restart
After step 3, the MX settings got back to defaults in /var/service/tinydns/root/data.
How should I manage this?