Bind-DLZ question
Graeme Fowler
graeme at graemef.net
Tue Jan 15 15:49:41 UTC 2008
Hi
On Mon, 2008-01-14 at 14:16 -0700, Tagg McDonald wrote:
> I was wondering if its possible to so some conversion of the zone name
> in bind
Probably not...
> I want to put each zone in its own table but since I cant name tables
> "example.com". I would like to convert "example.com" to "example_com"
> for the MySQL query, is such a thing possible ?
...but it might be in MySQL. My SQL-foo is fairly weak, but I have a
sneaking suspicion you might be able to do something like:
SELECT * FROM (SELECT REPLACE('example.com','.','_')) AS tbl;
Right now that will return:
+--------------------------------+
| REPLACE('example.com','.','_') |
+--------------------------------+
| example_com |
+--------------------------------+
1 row in set (0.00 sec)
which isn't quite what you want. But it's close! I've just had one of
our resident SQL wizards have a look at the question, and he doesn't
think it's possible - the subquery returns a table, not a table *name*.
IMO you need to ask someone with some *really* strong MySQL skills about
this. It almost certainly isn't a BIND problem.
That said, why would you want all your zones in different tables? It
seems a very inefficient way of storing them, and will result in a large
number of small tables instead of a small number of large tables. Guess
which MySQL indexes best, and therefore runs better with? And if you did
that, you don't need to fiddle with the query statements (thus adding
overhead) you're passing from the -dlz driver to the backend DB engine,
either.
Graeme
More information about the bind-users
mailing list