diff --git a/README.md b/README.md
index 8cce2076273184f0f6fa830a7c3960beea02f51d..929b7b434d055775c5f450161eabe8431ce3fc4b 100644
--- a/README.md
+++ b/README.md
@@ -284,6 +284,16 @@ you will see errors like "No connections available and at max connection limit".
 this to MORE than the number of threads means that there are more connections than necessary.
 Leave blank to set it to the same value as the number of threads.
 
+##### `query_file`
+
+Default: `sql/${database}/dialup.conf`. Relative path to the file which contains your SQL queries. By
+default, points to the `dialup.conf` specific to your database engine, so leave this blank if you are
+using stock queries.
+
+If you need to use custom queries, it is recommended that you deploy your query file using
+`freeradius::script` to install the file into `/etc/raddb/scripts/custom_dialup.conf` and then
+set `query_file` to `scripts/custom_dialup.conf`.
+
 
 #### `freeradius::statusclient`
 
diff --git a/manifests/sql.pp b/manifests/sql.pp
index aec5698fe160546743dd04562765146e0119c709..13eddeb85715a3b92268cc9fbeecc097ea3c67ab 100644
--- a/manifests/sql.pp
+++ b/manifests/sql.pp
@@ -6,6 +6,7 @@ define freeradius::sql (
   $login = 'radius',
   $radius_db = 'radius',
   $num_sql_socks = '${thread[pool].max_servers}',
+  $query_file = 'sql/${database}/dialup.conf',
 ) {
   $fr_package  = $::freeradius::params::fr_package
   $fr_service  = $::freeradius::params::fr_service
diff --git a/templates/sql.conf.erb b/templates/sql.conf.erb
index f74f1337a11fbda6091165f28003797f9d279113..b9c5d947ecf5f4f209fbb93c1c35657da445deb6 100644
--- a/templates/sql.conf.erb
+++ b/templates/sql.conf.erb
@@ -111,5 +111,5 @@ sql {
 	nas_table = "nas"
 
 	# Read driver-specific configuration
-	$INCLUDE sql/${database}/dialup.conf
+	$INCLUDE <%= @query_file %>
 }