Use DNS directly from your database
mysql> SELECT lookup('localhost');
+---------------------+
| lookup('localhost') |
+---------------------+
| 127.0.0.1 |
+---------------------+
1 row in set (0.00 sec)
mysql> SELECT reverse_lookup('127.0.0.1');
+-----------------------------+
| reverse_lookup('127.0.0.1') |
+-----------------------------+
| localhost |
+-----------------------------+
1 row in set (0.00 sec)
This is how you install these functions.
- Build udf_example.so which is in your mysql source. (make udf_example.so)
- Copy the udf_example.so file from your build directory to your plugin_dir.
- Create the lookup and reverse_lookup functions
mysql> CREATE …[Read more]