<h3>Description</h3>
<p>When setting <code>listen</code> with <code>advertise</code> in the configuration file the advertise section cannot contain an address that has the string <code>dns</code> within it. If at any point the domain used in advertise contains the three letters consecutively without being broken by a hypen or a dot it causes the parser to fail, see logging below.</p>
<p>I tried quoting the string but it didn't seam to parse properly. It interpenetrated the full thing as the listen address portion.</p>
<h3>Troubleshooting</h3>
<h4>Reproduction</h4>
<p>Add any advertise address to the config file with the string dns.<br>
e.g.</p>
<pre><code>listen=tcp:127.0.0.1:5060 advertise sip.dns.example.com:5060
</code></pre>
<p>Also using it in the <code>advertised_address</code> section without quotes causes the error.</p>
<pre><code>advertised_address=sip.dns.example.com:5060
</code></pre>
<h4>Log Messages</h4>
<pre><code> 0(98) CRITICAL: <core> [core/cfg.y:3507]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 62, column 43-45: syntax error                              
 0(98) CRITICAL: <core> [core/cfg.y:3507]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 62, column 43-45: invalid host or interface name            
 0(98) CRITICAL: <core> [core/cfg.y:3507]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 62, column 43-45: ip address, interface name or hostname expected
 0(98) CRITICAL: <core> [core/cfg.y:3507]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 62, column 47-54:                                           
ERROR: bad config file (4 errors)
```

### Possible Solutions

A solution could be to use the a `advertised_address` though the cookbook states that this could be deprecated in future and that the `listen` config parameter is preferred.

### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

```
version: kamailio 5.2.1 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES                                                  
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB                                                                    
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 6.3.0
```

* **Operating System**:



Running in Debian container image.
```
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Linux 1498e1ef835d 4.20.6-arch1-1-ARCH #1 SMP PREEMPT Thu Jan 31 08:22:01 UTC 2019 x86_64 GNU/Linux
```
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1854">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZbwJ8oQDyyLMzem8AKFT94g_Ii9Tks5vN2hrgaJpZM4a-uXa">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZUbzeTR_3lz6KQ8uyB8YjN3pohD8ks5vN2hrgaJpZM4a-uXa.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"listen option in cfg cannot contain `dns` in the advertise portion (#1854)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1854"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1854",
"url": "https://github.com/kamailio/kamailio/issues/1854",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>